This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unique: (array, test) -> | |
result = [] | |
seen = [] | |
for item in array | |
computed = test(item) | |
if seen.indexOf(computed) | |
seen.push(computed) | |
result.push(item) | |
return result |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs') | |
var rawData = JSON.parse(fs.readFileSync('city.list.json', 'utf8')) | |
var formatedData = {} | |
rawData.forEach(function(city){ | |
var country = city.country | |
if (!(country in formatedData)){ | |
formatedData[country] = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getSquare(canvas, evt) { | |
var rect = canvas.getBoundingClientRect(); | |
var values = this.scroller.getValues(); | |
return { | |
x: Math.ceil((((evt.clientY - rect.top + values.top) / values.zoom) - ((evt.clientY - rect.top + values.top)/values.zoom) % cellHeight) / cellHeight), | |
y: Math.ceil((((evt.clientX - rect.left + values.left) / values.zoom) - ((evt.clientX - rect.left + values.left)/values.zoom) % cellWidth) / cellWidth) | |
}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
[ | |
[ | |
"Βασίλειος", | |
"Βασίλης", | |
"Βάσος", | |
"Βασίλας", | |
"Βασιλάκης", | |
"Μπίλλης", | |
"Μπίλης", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import struct | |
import SocketServer | |
from base64 import b64encode | |
from hashlib import sha1 | |
from mimetools import Message | |
from StringIO import StringIO | |
# import threading | |
class WebSocketsHandler(SocketServer.StreamRequestHandler): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%encoding utf-8 | |
\documentclass[12pt]{article} | |
\usepackage[greek,english]{babel} | |
\usepackage[utf8x]{inputenc} | |
\begin{document} | |
{\selectlanguage{greek}Ελληνικά και} english | |
\end{document} |
NewerOlder