Skip to content

Instantly share code, notes, and snippets.

View zbee's full-sized avatar
👾

Ethan Henderson zbee

👾
View GitHub Profile
@nijikokun
nijikokun / generateJsonSchema.js
Created February 16, 2015 23:19
Generate (BASIC) JSON Schema from JSON Object
var Type = require('type-of-is')
module.exports = function generateJsonSchema (object) {
for (var key in object) {
var value = object[key]
var type = Type.string(value).toLowerCase()
if (type === 'undefined') {
type = 'null'
}
@zbee
zbee / _iso8601.md
Last active March 13, 2016 16:32
How to do ISO 8601 in various languages (2015-01-14T20:55).
@GonchuB
GonchuB / keysToLowerCase.js
Created March 19, 2014 14:57
convert json keys to lowercase recursively.
/**
* Created by gonchub on 19/03/14.
*/
function keysToLowerCase(obj) {
if (!typeof(obj) === "object" || typeof(obj) === "string" || typeof(obj) === "number" || typeof(obj) === "boolean") {
return obj;
}
var keys = Object.keys(obj);
var n = keys.length;
var lowKey;
@stephanetimmermans
stephanetimmermans / ubuntu-compass-ruby
Last active July 4, 2019 12:48
Install Compass+Ruby on Ubuntu 14.04
#https://gorails.com/setup/ubuntu/14.04
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install 2.1.2
rvm use 2.1.2 --default
@avdg
avdg / gist:2210109
Created March 26, 2012 22:03
Bootstrap popover triggered by hover, fading away in few seconds
var tmp = null;
$('###selector###').popover({
trigger: 'manual',
title: 'testing',
delay: {show:500, hide:100}
});
$('###selector###').hover(function(){
clearTimeout(tmp);
@udev
udev / genymotionwithplay.md
Last active September 25, 2021 02:33 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services

#Download the following ZIPs: ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)

#Download the correct GApps for your Android version: Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip) Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip) Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip) Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip) Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip) Google Apps for Android 4.2 (https://www.androidfilehost.com/?fid=23060877490000128 - gapps-jb-20130812-signed.zip)

@zekesonxx
zekesonxx / linkfilterbypass.user.js
Last active November 5, 2021 10:04
Steam Link Filter Bypasser
// ==UserScript==
// @name Steam Link Filter Bypass
// @author Zeke Sonxx
// @namespace zekesonxx
// @version 0.2
// @description Bypasses the Steam link filter
// @match https://steamcommunity.com/linkfilter/*
// @include https://steamcommunity.com/linkfilter/*
// @copyright 2014, Zeke Sonxx, MIT Licensed
// ==/UserScript==
@caseywatts
caseywatts / MediawikionHeroku.md
Last active August 16, 2022 06:28
Mediawiki on Heroku
@signed0
signed0 / gist:2031157
Created March 13, 2012 19:53
Google Polyline encoder & decoder
'''Provides utility functions for encoding and decoding linestrings using the
Google encoded polyline algorithm.
'''
def encode_coords(coords):
'''Encodes a polyline using Google's polyline algorithm
See http://code.google.com/apis/maps/documentation/polylinealgorithm.html
for more information.
@nijikokun
nijikokun / example-user.js
Created May 3, 2012 20:46
Beautiful Validation... Why have I never thought of this before?!
var user = {
validateCredentials: function (username, password) {
return (
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' }
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' }
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' }
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' }
: (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' }
: false
);