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
from multiprocessing import Pool | |
from time import sleep | |
from random import randint | |
import os | |
class AsyncFactory: | |
def __init__(self, func, cb_func): | |
self.func = func | |
self.cb_func = cb_func |
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
<?php | |
/** | |
* Author: Abu Ashraf Masnun | |
* URL: http://masnun.me | |
*/ | |
class GridCalculator implements Iterator | |
{ | |
private $maximumX, $maximumY, $minimumX, $minimumY; |
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
from zooz import ZoozClient | |
zooz = ZoozClient(unique_id='<unique id>', | |
app_key='<app key>', | |
sandbox=True) | |
transaction = {'cmd': 'openTrx', | |
'amount': '0.99', | |
'currencyCode': 'USD'} |
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
"================== | |
" My Configuration | |
"================== | |
syntax on | |
set wrapscan | |
set number | |
set backspace=start,indent,eol | |
set t_Co=256 | |
colorscheme wombat256mod | |
autocmd FileType php set omnifunc=phpcomplete#CompletePHP |
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 (text) { | |
this.text = text; | |
this.greet = function (closure) { | |
closure("Hello " + this.text + "!")(); | |
} | |
return this; | |
})('Javascript').greet(function (text) { | |
return function () { | |
console.log(text); | |
} |
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
{ | |
"auto_indent": true, | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Dayle Rees Color Schemes/LaravelDarker.tmTheme", | |
"draw_white_space": "all", | |
"fade_fold_buttons": false, | |
"fold_buttons": true, | |
"folder_exclude_patterns": | |
[ | |
".svn", |
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
Lighthouse: ~/Codes/compare | |
→ time python test.py | |
python test.py 0.05s user 0.01s system 96% cpu 0.067 total | |
Lighthouse: ~/Codes/compare | |
→ time php test.php | |
php test.php 0.56s user 0.03s system 99% cpu 0.598 total | |
Lighthouse: ~/Codes/compare | |
→ |
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
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="custom" | |
# Example aliases |
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
$entityManager = $this->getDoctrine()->getEntityManager(); | |
$user = new User(); | |
$user->setAddress("Khulna"); | |
$user->setBio("Good guy!"); | |
$user->setEmail("[email protected]"); | |
$user->setName("Masnun"); | |
$user->setIdentityProvider("facebook"); | |
$user->setProviderId("masnun"); | |
$user->setPhone("8801711960803"); |
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
#!/usr/bin/env python | |
class Eid(object): | |
def __get__(self,instance,owner): | |
return "Eid-Ul-Fitr " | |
class Salutation(object): | |
def __get__(self,instance,owner): | |
return "Mubarak!" |