Skip to content

Instantly share code, notes, and snippets.

View capan's full-sized avatar

Hüseyin Çapan capan

  • Carbmee
  • Berlin
  • 14:38 (UTC +02:00)
View GitHub Profile
@capan
capan / envi2gif
Created November 15, 2022 10:04
An IDL script for creating GIF file from envi files
pro envi2gif
e = ENVI()
File = FILEPATH('1990_urban.tif', Root_Dir='C:\Users\7tiffs')
image = READ_IMAGE (File)
image = REVERSE(image, 2)
filename = FILEPATH('1990_urban.gif', Root_Dir='C:\Users\30M')
WRITE_GIF, filename, bytscl(image)
end
@capan
capan / HackerRankUefa.js
Created September 12, 2021 17:26
Hacker Rank Uefa
const https = require('https');
const url = require('url');
async function getTeams(year, k) {
const teams = {};
const requestMaker = async (options) => new Promise((resolve, reject) => {
let data = '';
const formattedUrl = url.format({
protocol: 'https',
@capan
capan / settings.json
Last active September 19, 2022 13:19
sample vscode settings for custom fonts
{
"javascript.updateImportsOnFileMove.enabled": "always",
"window.zoomLevel": 0,
"todo-tree.tree.showScanModeButton": false,
"git.autofetch": true,
"explorer.confirmDelete": false,
"editor.insertSpaces": false,
"diffEditor.ignoreTrimWhitespace": false,
"editor.formatOnSave": true,
"[typescript]": {
@capan
capan / memo.js
Created June 28, 2020 12:44
JavaScript Memoization Example for Reducing the Time Complexity
const veryComplexCalculation = (n) => (n * 10);
const memoize = (cb) => {
const cache = {};
return (n) => {
if (n in cache) {
console.log('Retrieving from cache:', n);
return cache[n];
} else {
console.log('Calculating ...');

Trivia Game

In this task, you are going to create a multiple choice quiz game with React.js using Open Trivia Database You may use any additional library that you like.

Requirements

  • User should be able to start game by pressing a button
  • A game should be containing at least 10 questions.
  • If user selects the wrong answer, game ends.
@capan
capan / ReactTerminal.js
Created November 22, 2019 14:27
React + Node.js Terminal emulation
import React from 'react';
import { Terminal } from 'xterm';
import PageBase from './pages/PageBase';
import openSocket from 'socket.io-client';
import { FitAddon } from 'xterm-addon-fit';
class ReactTerminal extends PageBase {
constructor(props) {
super(props);
this.state = {};
@capan
capan / client.js
Created November 21, 2019 11:35 — forked from steinwaywhw/client.js
A minimal term.js server/client demo. To be used with node.js
var client = {};
client.run = function (options) {
options = options || {};
var socket = io.connect(options.remote || "http://localhost:8080");
socket.on('connect', function() {
var term = new Terminal({
@capan
capan / README.md
Created December 10, 2018 12:48 — forked from rochoa/README.md
CARTO Node.js code test

CARTO Node.js code test

Introduction

At CARTO, among other things, we render maps, just check this example of Map with countries and USA states.

In order to limit the scope of the challenge, we are gonna use Mapnik and Node.js. Within this repository, we are providing all the pieces you need to reproduce that map. Well, all pieces except the map tile server.

An example of how to create an image with Mapnik: