Skip to content

Instantly share code, notes, and snippets.

var unique = function(array) {
return array.reduce(function(memo, elem) {
if (memo.indexOf(elem) < 0) memo.push(elem);
return memo;
}, []);
};
// Example
//
// var callback = function(error, data) {console.log('Done.', error, data);};
@b1
b1 / translit.py
Created March 31, 2011 09:21 — forked from naspeh/translit.py
# -*- coding: utf-8 -*-
import re
RU = (
u'ёыъэ',
u'а,a;б,b;в,v;г,g;д,d;е,e;ё,yo;ж,zh;з,z;и,i;'
u'й,y;к,k;л,l;м,m;н,n;о,o;п,p;р,r;с,s;т,t;'
u'у,u;ф,f;х,h;ц,c;ч,ch;ш,sh;щ,shh;ъ,\";ы,y;ь,\';'
u'э,e;ю,yu;я,ya'