Skip to content

Instantly share code, notes, and snippets.

@psychemedia
psychemedia / Cross Domain JQuery with Yahoo Pipes Proxy
Created February 27, 2010 12:20
Make cross domain JSON calls in JQuery for JSON feeds that don't support JSONP. Using a Yahoo Pipe as a proxy, pass in the URI for your JSON feed from any domain, and grab the Pipe's JSONP proxy output into your page.
function cross_domain_JSON_call(url){
// url points to a JSON feed
// eg http://openlylocal.com/committees.json?council_id=111
url="http://pipes.yahoo.com/ouseful/jsonproxy?url="+encodeURIComponent(url)+"&_render=json&_callback=?";
$.getJSON(
url,
function(data) { myCallbackFunction(data.value.items[0]); }
)
@ryanohs
ryanohs / gist:2048500
Created March 16, 2012 04:24
Merge Sort - CoffeeScript
mergesort = (input) ->
n = input.length
if n == 1
return input
pivot = Math.floor n/2
a = mergesort input[0...pivot] # coffee script does not include the last element in a slice
b = mergesort input[pivot...n]
merge(a, b)
merge = (a, b) ->
@johndbritton
johndbritton / Command Log
Created October 25, 2012 00:53
Git + GitHub at Virginia Tech
mkdir vt
cd vt
ls -alh
git init
ls -ahl
cd .git/
ls
rm -rf hooks
cd vt/.git/
tree
@mscdex
mscdex / gist:8493112
Created January 18, 2014 16:55
Use npm API from system copy of npm
function loadNpm(cb) {
require('child_process').exec('npm', function(err, stdout, stderr) {
if (err) return cb(err);
var m = /npm@[^ ]+ (.+)\n/i.exec(stdout);
if (!m)
return cb(new Error('Unable to find path in npm help message'));
cb(undefined, require(m[1]));
});
}
@ninadsp
ninadsp / notification_cleanup_task.xml
Created August 11, 2016 06:33
Notification SMS Clean up task for Tasker
<TaskerData sr="" dvi="1" tv="4.8u5m">
<Task sr="task49">
<cdate>1470858510504</cdate>
<edate>1470869694940</edate>
<id>49</id>
<nme>Notification Sms Cleanup</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>355</code>
<Str sr="arg0" ve="3">%sms_retention_rules</Str>
@iambibhas
iambibhas / food_delivery_startups
Last active June 26, 2017 09:34
Food delivery startups in Bangalore
brekkie.in
chefensa.co.in
chefkraft.com
dazo.in
delyver.com
dinerdeliver.com
dropkaffe.com
eatfresh.com
eatloapp.com
eatongo.in
@captn3m0
captn3m0 / index.mkd
Created June 16, 2012 06:13 — forked from AartiNdi/Hash Functions.
Brief summary of what I know about hash functions

##BLOG ON CRYPTOGRAPHY

Today, people in general relate to cryptography mostly in regard to the security of their passwords. The passwords are worthless if others have resources to know it.

Today most of the websites dont simply use cryptographic hash functions like SHA256, MD5 etc. directly on the password. Instead random bits ( salt ) are added while encrypting them so that even when two users enter the same password the hashes that are generated are different from each other.

Hashes like SHA1 , SHA256, MD5 etc. are general purpose hashes. They have been designed to hash a large amount of data as quickly as possible.

An encryption algorithm for securely storing your password should have the following characteristics:

@addyosmani
addyosmani / cranium.js
Last active February 7, 2019 15:02
Cranium
/* Cranium MVC
* A minimalist MVC implementation written for
* demonstration purposes at my workshops
* http://addyosmani.com
* Copyright (c) 2012 Addy Osmani; Licensed MIT */
var Cranium = Cranium || {};
// Set DOM selection utility
@bomberstudios
bomberstudios / muji-dotted-paper.ps
Created July 20, 2012 11:24
Print your own Muji dotted paper in A4 format (open in Preview.app, print at 100% scale)
%!PS-Adobe-3.0
% Title: dot grid paper, 5x5 mm
%%BeginSetup
%%BeginFeature: *PageSize A4
<< /PageSize [ 595.27 841.889 ]
/ImagingBBox null
>> setpagedevice
%%EndFeature
%%EndSetup
@kirarpit
kirarpit / robbie_ppo_rllib.py
Last active June 17, 2019 06:35
Robbie the soda-can-collecting robot (https://bit.ly/2MPUku5) trained with a deep RL algorithm, PPO, with the help of Ray RLlib.
import ray
from gym import spaces
from ray.rllib.env.multi_agent_env import MultiAgentEnv
import numpy as np
from ray.tune.registry import register_env
from ray.rllib.agents.registry import get_agent_class
from ray.rllib.rollout import rollout
import time
from ray import tune