Skip to content

Instantly share code, notes, and snippets.

{ "abc": 123 }
@lkrids
lkrids / JS Template
Last active April 12, 2018 22:37
template for adding jquery code before jquery has loaded
(function () {
function run () {
// jquery code goes here
// only edit in this function
// custom code or plugins get written/pasted in this function
}
{
"images": [
{
"image": "/images/PlayerCard_1.png",
"date": "1439772978057",
"$el": ""
},
{
"image": "/images/PlayerCard_2.png",
"date": "1439772976057",
# -*- mode: ruby -*-
# vi: set ft=ruby :
# This is a Vagrant configuration file. It can be used to set up and manage
# virtual machines on your local system or in the cloud. See http://downloads.vagrantup.com/
# for downloads and installation instructions, and see http://docs.vagrantup.com/v2/
# for more information and configuring and using Vagrant.
Vagrant.configure("2") do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
@lkrids
lkrids / addEventListener-polyfill.js
Created June 4, 2012 14:14 — forked from eirikbacker/addEventListener-polyfill.js
addEventListener polyfill for IE6+
//addEventListener polyfill 1.0 / Eirik Backer / MIT Licence
(function(win, doc){
if(win.addEventListener)return; //No need to polyfill
function docHijack(p){var old = doc[p];doc[p] = function(v){return addListen(old(v))}}
function addEvent(on, fn, self){
return (self = this).attachEvent('on' + on, function(e){
var e = e || win.event;
e.preventDefault = e.preventDefault || function(){e.returnValue = false}
e.stopPropagation = e.stopPropagation || function(){e.cancelBubble = true}
@lkrids
lkrids / hack.sh
Created March 19, 2012 14:21 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@lkrids
lkrids / twitter_streaming.js
Created February 12, 2012 08:39 — forked from ryanmcgrath/twitter_streaming.js
Access the Twitter Streaming API with ease (Node.js).
var util = require('util'),
http = require('http'),
events = require('events');
var Twitter = function(opts) {
this.username = opts.username;
this.password = opts.password;
this.track = opts.track;
this.data = '';
};
/*
* Solution for Gild contest: http://www.gild.com/puzzles/details/321?language=javascript
* Code runs on Rhino js environment: http://www.mozilla.org/rhino/
*
* usage: java -jar rhino.jar this_file.js encrypted_file.txt
* encrypted_file.txt syntax (1st line is an integer, following lines are encrypted). Example:
* 87
* Qxuuhfxxm bynjtrwp: juu hxda lxwcnwc jan knuxwp cx db! Yjbb cqrb kruu xa uron fruu nwm!
* * * * *
* the output should be: