Skip to content

Instantly share code, notes, and snippets.

View BillyWM's full-sized avatar
🙉
🕹

William Wenge-Murphy BillyWM

🙉
🕹
View GitHub Profile
@nogweii
nogweii / github_news_feed_minimizer.user.js
Created April 23, 2010 02:04
An attempt at making the news feed better, cleaner, and less noisy.
// ==UserScript==
// @name Github news feed minimizer
// @namespace evaryont.me
// @include https://github.com/
// @include https://github.com/dashboard/yours
// @datecreated 2010-04-22
// @version 0.1
// @author Colin 'Evaryont' Shea
// @license MIT
// @description Do many little things, but overall, make the whole page a lot better.
@sli
sli / fan-c.c
Last active September 24, 2015 08:18
Fancy C dialect for prim and proper programmeurs.
//#define ?? auto
#define cease break
#define upon case
//#define ?? char
#define steadfast const
#define abide continue
//#define ?? default
#define undertake do
//#define ?? double
#define otherwise else
@egonelbre
egonelbre / gist:938938
Created April 23, 2011 20:19
wave generation speed up
freq = 770; len = 10; rate = 44100; vol = 1.0;
start = new Date();
w = '';
phase = 0;
sin = Math.sin;
chr = String.fromCharCode;
total = len*rate;
@brandon-fryslie
brandon-fryslie / genetic.js.coffee
Created February 24, 2012 08:32
Genetic Algorithm in CoffeeScript
# Add some useful features to array prototypes
Array::fold = (initial, fn) -> initial = fn initial, x for x in @; initial
Array::sum = -> @fold 0, (memo, i) -> memo + i
Array::mean = -> @sum() / @length
Array::max = -> Math.max.apply {}, @
Array::min = -> Math.min.apply {}, @
Array::median = -> if @length % 2 is 0 then (@[@length/2-1]+@[@length/2])/2 else @[Math.ceil @length/2]
Array::variance = -> avg = @mean(); @fold(0, (memo, i) -> memo + Math.pow i-avg, 2) / @length
Array::std_dev = -> Math.sqrt @variance()
$(document).ready(function(){
$(".disappear").click(function(){
$("#row20").animate({ "opacity": "0" },
100,
function(){$("#row19").animate({ "opacity": "0" },
100,
function(){$("#row18").animate({ "opacity": "0" },
100,
function(){$("#row17").animate({ "opacity": "0" },
100,
@svallory
svallory / font-awesome-mixins.less
Created August 30, 2012 04:04
FonAwesome Icons using Mixins instead of classes (Please see the first comment)
/* Font Awesome
the iconic font designed for use with Twitter Bootstrap
-------------------------------------------------------
The full suite of pictographic icons, examples, and documentation
can be found at: http://fortawesome.github.com/Font-Awesome/
License
-------------------------------------------------------
The Font Awesome webfont, CSS, and LESS files are licensed under CC BY 3.0:
http://creativecommons.org/licenses/by/3.0/ A mention of
@qrohlf
qrohlf / helloworld
Last active July 26, 2016 18:31
Ruby Hello World
  = 1
   =  + 
    =   *  + 
     =    *  
      =
[     *(   +  )+  ,
        =     *    + ,
         =     *    +    -  ,
        ,
        =        +    ,
@efruchter
efruchter / HelloWorld.lua
Created June 5, 2013 20:48
A simple intro to the Lua language, with everybody's favorite program, Hello World! Credit goes to Corsix.org.
_={_=_G}for--[[]]__--[[]]in(next),_["_"]do(_)[_]=(__)_[#_[_]],_[_[_]:byte(-#"#"
)+#_[_]-(#{}+#"(#''"*#"*#*#*"*#"_[_[]]")]=_[_],_[_]end(_)[_]=_._[_[#""]]{[_._[_
[#""]]]=_}_[""]=_._[_._[_[#[=[=#=]=]*-((#[=[#[=]#]=]))]](_._[_[-#[[_[-#[#_[_]]]
](_))]_[";"]=_._[_[#"#"+(#")#^")^#"#^"]]_["'"]=[[sub]]_['"']=_[""][_["'"]]_["/"
]=[[/_)=.,[#"('*:^;+]]_["'"]=_[""][_['"'](_[-#[[=[=]=]]],-#",_",-#"..").._["'"]
]_["["]=_['"'](_[-#"#-]_"],#",",#{_}).._['"'](_[-#"-"],#",",#"#").._['"'](_[-(#
"^#^")^#"^#"],#"-",#"(").._['"'](_[#_[-#"#"]*-#"[#"],#_[-#"#"],#_[-#"#"]).._[''
..'"'](_[-#[[=[]=]]],#_["/"]/#_["/"],#"/").._['"'](_[-(#"#)-")^#[[""]]],-#"-,",
-#[=[[]]=])_["]"]=_['"'](_[-#_[-#"-"]],#",",#"#").._[";"](_["["]..[=[('\]=]..(#
'#).'*#',..]]'*#'",#"#",'-#'(').."')")().._['"'](_[-#_[-#"-"]],-#_[-#"-"]-#"-",
@ericelliott
ericelliott / custom-iterable.js
Last active July 23, 2018 23:29
JavaScript custom iterable
const countToThree = {
a: 1,
b: 2,
c: 3
};
countToThree[Symbol.iterator] = function* () {
const keys = Object.keys(this);
const length = keys.length;
@dmajda
dmajda / gist:1926638
Created February 27, 2012 19:58
Semantic predicates and label visibility in PEG.js
/*
* Task: Parse even numbers in PEG.js (http://pegjs.majda.cz).
*
* Solution: Let's parse all numbers and reject odd ones using a semantic
* predicate -- an arbitrary piece of code that returns true (meaning "continue
* parsing") or false (meaning "halt parsing").
*
* This solution wouldn't work before commit a2af1fe612 because predicates
* didn't have access to labeled expressions in the grammar as variables
* (without ugly workarounds). But they have the access now and the solution