Skip to content

Instantly share code, notes, and snippets.

View eAmin's full-sized avatar
:octocat:

Amin Akbari eAmin

:octocat:
View GitHub Profile
@eAmin
eAmin / use.js
Created January 19, 2011 12:18
Very Simple CSS Selector
/*!
* Simple CSS Selector
* Copyright(C) 2010 by Amin Akbari [ eAmin.js on gmail ]
* Licenced under the MIT Style License [http://www.opensource.org/licenses/mit-license.php]
* Created on: 1/22/2010
*/
var selector = function(query) {
var trim = function(arg) { return arg.replace(/^\s+|\s+$/, ''); };
var contains = function(arg1, arg2) { return arg1.indexOf(arg2) !== -1; };
@eAmin
eAmin / en2fa.js
Created January 19, 2011 12:33
English Digit to Persian
/*
* English digit to persian
* Copyright(C) 2009 by Amin Akbari [ http://eAmin.me/ ]
* Licensed under the MIT Style License [http://www.opensource.org/licenses/mit-license.php]
*
*/
String.prototype.toFaDigit = function() {
return this.replace(/\d+/g, function(digit) {
var ret = '';
@eAmin
eAmin / western2fa.js
Created January 19, 2011 12:37
ISO-Western to persian
/**
* Original by AHHP(Amir Hossein Hodjaty Pour) ~ Boplo@Boplo.ir
* Port to JavaScript by Amin Akbari [ eAmin.js on Gmail ]
* License : GPL
*/
function western_to_persian(str) {
var character = {
'\u00db\u00b0' : '\u06f0', '\u00db\u00b1' : '\u06f1', '\u00db\u00b2' : '\u06f2', '\u00db\u00b3' : '\u06f3', '\u00db\u00b4' : '\u06f4', '\u00db\u00b5' : '\u06f5', '\u00db\u00b6' : '\u06f6', '\u00db\u00b7' : '\u06f7', '\u00db\u00b8' : '\u06f8',
'\u00db\u00b9' : '\u06f9', '\u00d8\u00a2' : '\u0622', '\u00d8\u00a7' : '\u0627', '\u00d8\u00a3' : '\u0623', '\u00d8\u00a5' : '\u0625', '\u00d8\u00a4' : '\u0624', '\u00d8\u00a6' : '\u0626', '\u00d8\u00a1' : '\u0621', '\u00d8\u00a8' : '\u0628',
@eAmin
eAmin / gist:3415934
Created August 21, 2012 14:21 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@eAmin
eAmin / Grep.js
Created January 28, 2013 11:33 — forked from nicdaCosta/Grep.js
/*
Grep.js
Author : Nic da Costa ( @nic_daCosta )
Created : 2012/11/14
Version : 0.2
(c) Nic da Costa
License : MIT, GPL licenses
Overview:
Basic function that searches / filters any object or function and returns matched properties.
@eAmin
eAmin / simpleRGP.php
Last active December 17, 2015 23:39
Generate random bytes from /dev/urandom/
function gen_random_pass($length=20) {
return (function_exists('openssl_random_pseudo_bytes')) ?
base64_encode(openssl_random_pseudo_bytes($length))
: base64_encode(mcrypt_create_iv($length, MCRYPT_DEV_URANDOM));
}
$generate = gen_random_pass();
echo 'Generated password: '.$generate;
@eAmin
eAmin / dabblet.css
Created December 19, 2013 15:35 — forked from LeaVerou/dabblet.css
/**
* (C)Leanest CSS spinner ever
*/
@keyframes spin {
to { transform: rotate(1turn); }
}
.progress {
position: relative;
@eAmin
eAmin / dabblet.css
Created December 19, 2013 15:38 — forked from LeaVerou/dabblet.css
/* Polygon kitties - By @LeaVerou */
div {
display: inline-block;
position: relative;
width: 200px;
height: 200px;
margin: 40px;
overflow: hidden;
backface-visibility: hidden; /* hack to make it smoother, suggested by Mottie */
@eAmin
eAmin / dabblet.css
Created December 19, 2013 15:39 — forked from LeaVerou/dabblet.css
/**
* iMessage-style loader
*/
@keyframes fade {
to { background: rgba(0,0,0,.1); }
}
.progress,
.progress:before,
@eAmin
eAmin / dabblet.css
Created December 19, 2013 15:43 — forked from LeaVerou/dabblet.css
/**
* Getting the month names from the browser
*/