This file contains 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 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 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 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 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 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
#!/bin/bash | |
# Expand globs to null when there are no matches | |
shopt -s nullglob | |
# Look for either a '<subdir>/console' or a 'symfony' file | |
until | |
file=(*/console symfony); [[ -f "$file" ]] && php "$file" "$@" && exit; | |
do | |
[[ "$PWD" == "/" ]] && break; |
This file contains 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
{% extends 'emails/html/base.html' %} | |
{% block body %} | |
<h2 class="null" style="color: rgb(51, 51, 51); font-family: Arial, Verdana, sans-serif; line-height: 20.796875px;"><span style="font-size:14px;"><span style="line-height: 1.6em; color: rgb(32, 32, 32); font-family: Arial;">Hi <First Name>,</span></span></h2> | |
<p style="color: rgb(51, 51, 51); font-family: Arial, Verdana, sans-serif; font-size: 13px; line-height: 20.796875px;"><br /> | |
<span style="font-size:14px;">Thanks for booking at <a href="http://www.aircourts.com" target="_self">aircourts.com</a>! </span><br /> | |
</p> |
This file contains 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 subprocess import Popen, PIPE, call | |
from sys import argv, exit | |
from time import sleep | |
from os import getpid | |
def get_process_list(app): | |
ps_aux = Popen(["ps", "aux"], stdout=PIPE) | |
grep = Popen(["grep", app], stdin=ps_aux.stdout, stdout=PIPE) | |
awk = Popen(["awk", "{print $2}"], stdin=grep.stdout, stdout=PIPE) | |
ps_aux.stdout.close() |
This file contains 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
(require '[clojure.tools.namespace.repl :refer [refresh]]) | |
(refresh) | |
(-main) |
This file contains 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
(defproject my-project "0.1.0-SNAPSHOT" | |
:description "FIXME: write description" | |
:url "http://example.com/FIXME" | |
:main my-project.core | |
:license {:name "Eclipse Public License" | |
:url "http://www.eclipse.org/legal/epl-v10.html"} | |
:profiles {:dev {:source-paths ["startup"]}} | |
:dependencies [[org.clojure/clojure "1.6.0"] |