Skip to content

Instantly share code, notes, and snippets.

View erdem's full-sized avatar

Erdem Ozkol erdem

View GitHub Profile
@erdem
erdem / timezone_locations.py
Last active April 18, 2020 14:51
Center location coordinates for timezones
TIMEZONE_COORDINATES = {
'Africa/Abidjan': [8, -5],
'Africa/Accra': [8, -2],
'Africa/Addis_Ababa': [8, 38],
'Africa/Algiers': [28, 3],
'Africa/Asmara': [15, 39],
'Africa/Bamako': [17, -4],
'Africa/Bangui': [7, 21],
'Africa/Banjul': [13.46666666, -16.56666666],
'Africa/Bissau': [12, -15],
@erdem
erdem / countries.json
Last active May 30, 2024 22:37
Country list as JSON format. fields: name, coordinates, timezones, country code and capital resource: https://github.com/mledoze/countries
[
{
"timezones": [
"America/Aruba"
],
"latlng": [
12.5,
-69.96666666
],
"name": "Aruba",
@erdem
erdem / codingame_mime_type.py
Created December 1, 2015 23:49
Codingame MIME Type puzzle solution
import sys
import math
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
n = int(raw_input()) # Number of elements which make up the association table.
q = int(raw_input()) # Number Q of file names to be analyzed.
mime_type_map = {}
@erdem
erdem / codingame_chuck_norris.py
Last active November 30, 2015 01:25
Codingame Chuck Norris keyboard puzzle
message = raw_input()
binaries = ""
for c in message: # converting all inputs to 7 bit
bnr = format(ord(c), 'b')
if len(bnr) < 7:
bnr = "0"*(7-len(bnr)) + bnr
binaries += bnr
@erdem
erdem / ascii_art.py
Created November 29, 2015 23:34
Codingame ASCII Art Puzzle
l = int(raw_input())
h = int(raw_input())
t = raw_input()
result = []
characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ?"
for i in xrange(h):
row = raw_input()
threshold = len(row)/len(characters)
chr_width = threshold
matrix = [
[1, 2, 3, 4, 5, 6, 7],
[7, 6, 5, 4, 3, 2, 1],
[6, 5, 4, 3, 2, 1, 7],
[4, 3, 2, 1, 7, 6, 5],
[2, 1, 7, 6, 5, 4, 3],
[5, 6, 7, 1, 2, 3, 4],
[3, 2, 1, 7, 6, 5, 4],
]
@erdem
erdem / power-of-thor.js
Created November 17, 2015 10:45
CodinGame: Power of Thor
i = readline().split(' ').map(Number);
LX = i[0];
LY = i[1];
TX = i[2];
TY = i[3];
while (1) {
s = LX==TX && LY<TY && "N" || "";
s += LX==TX && LY>TY && "S" || "";
s += LY==TY && LX<TX && "W" || "";
@erdem
erdem / the-descent.js
Created November 2, 2015 23:23
CodinGame: The Descent
/**
* Auto-generated code below aims at helping you parse
* the standard input according to the problem statement.
**/
// game loop
while (true) {
var inputs = readline().split(' ');
var spaceX = parseInt(inputs[0]);
@erdem
erdem / skynet-the-chasm.js
Last active November 2, 2015 23:10
CodinGame: Skynet - The Chasm
/**
* Auto-generated code below aims at helping you parse
* the standard input according to the problem statement.
**/
var road = parseInt(readline()); // the length of the road before the gap.
var gap = parseInt(readline()); // the length of the gap.
var platform = parseInt(readline()); // the length of the landing platform.
var RoadAndGapLength = road+gap;