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 email.mime.text import MIMEText | |
from email.mime.multipart import MIMEMultipart | |
from subprocess import Popen, PIPE | |
html = MIMEText("<html><head><title>Test Email</title></head><body>Some HTML</body>", "html") | |
msg = MIMEMultipart("alternative") | |
msg["From"] = "[email protected]" | |
msg["To"] = "[email protected]" | |
msg["Subject"] = "Python sendmail test" |
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
{ | |
"title":"Tool Title", | |
"description": "Tool Description", | |
"version": "", | |
"author": { | |
"name":"", | |
"email":"", | |
"website":"" | |
}, | |
"repository_url": "", |
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
// http://paulirish.com/2011/requestanimationframe-for-smart-animating | |
// shim later with setTimeout fallback | |
window.requestAnimFrame = (function(){ | |
return window.requestAnimationFrame || | |
window.webkitRequestAnimationFrame || | |
window.mozRequestAnimationFrame || | |
window.oRequestAnimationFrame || | |
window.msRequestAnimationFrame || | |
function( callback ){ | |
window.setTimeout(callback, 1000 / 60); |
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 async = function(func,callback){ | |
return function(){ | |
var args = arguments; | |
setTimeout(function(){ | |
var values = func.apply(this, args); | |
callback.call(this, values); | |
}, 0); | |
}; | |
}; |
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 client = new DBClient(); | |
var db = client.setDatabase("test"); // If test doesnt exist creates it | |
var collection = db.getCollection("coll"); | |
// Find documents in a collection that match criteria | |
collection.selectDoc({name:"ayman"},function(data){ | |
// Callback for accessing and managing the returned data | |
}); |
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
class YoutubePublicAPI { | |
// Developers key to access the API | |
private $key; | |
private $base_url = "https://www.googleapis.com/youtube/v3/"; | |
public function __construct($params){ | |
$this->key = $params["key"]; | |
} |
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
f = open('input.txt') | |
lines = f.readlines() | |
lines = list(map(lambda x: int(x.strip()), lines)) | |
f.close() | |
d = {} | |
found = {} | |
for line in lines: | |
if line in d: |
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 re | |
import random | |
# Load the file into a graph represented by a dict of lists | |
def load_graph(): | |
g = {} | |
f = open('kargerMinCut.txt') | |
lines = f.readlines() | |
f.close() |
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
def get_total(n,p): | |
if n < p: | |
return 0 | |
elif n == p: | |
return 1 | |
else: | |
return 1 + get_total(n-2,p) | |
n = int(raw_input("money:")) |
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
/** JS of the index **/ | |
(function(){ | |
var data = $('#dev_list').html(); | |
for(var i = 0; i < 10; i++) | |
$("#dev_list").append(data); | |
/* Tab swiping init and next/prev functions */ |