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
/** 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 */ |
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
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 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 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 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 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 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 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 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 urlObject(options) { | |
"use strict"; | |
/*global window, document*/ | |
var url_search_arr, | |
option_key, | |
i, | |
urlObj, | |
get_param, | |
key, |
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 itertools import chain | |
intersection = [] | |
sets = [[0,4,5,2,1],[1,3,6,2,4],[4,1,2,5,7,0]] | |
merged = list(chain.from_iterable(sets)) | |
merged.sort() |