Skip to content

Instantly share code, notes, and snippets.

View binarymax's full-sized avatar
👻
for(;1;){work();eat();rest();}

Max Irwin binarymax

👻
for(;1;){work();eat();rest();}
View GitHub Profile
@peterc
peterc / domainavailable
Created February 13, 2009 13:30
Check if a domain is available to register (uses DNS before WHOIS to be fast) - supports .com,.net,.org,.co.uk - inspired by foca/giles http://gilesbowkett.blogspot.com/2009/02/simple-bash-domain-availability.html
#!/bin/bash
# domainavailable
# Fast, domain name checker to use from the shell
# Use globs for real fun:
# domainavailable blah{1..3}.{com,net,org,co.uk}
# Inspired by foca / giles:
# http://gilesbowkett.blogspot.com/2009/02/simple-bash-domain-availability.html
trap 'exit 1' INT TERM EXIT
@banksean
banksean / perlin-noise-classical.js
Created February 15, 2010 10:00
two Perlin noise generators in javascript. The simplex version is about 10% faster (in Chrome at least, haven't tried other browsers)
// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough banksean@gmail.com
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/
// http://www.evanmiller.org/how-not-to-sort-by-average-rating.html
// http://gist.github.com/raw/63002/b53853727856bad494dcbb7ffed4fc17f289af92/gistfile1.rb
// $z is the pnormaldist with power = 0.05. I.e., pnormaldist(1-power/2)
function score($pos, $n) {
if ($n == 0) { return 0; }
$z = 1.95996397158435;
$phat = 1.0*$pos/$n;
return ($phat + $z*$z/(2*$n) - $z * sqrt(($phat*(1-$phat)+$z*$z/(4*$n))/$n))/(1+$z*$z/$n);
}
@erkobridee
erkobridee / rest-json-js-frontend.md
Last active February 24, 2024 16:24
links úteis REST, JSON, HTML5, JavaScript e Twitter Bootstrap

Links úteis

  • A Rant about Estimation – When Will We Stop Being Crazy

  • InfoQ BR

    • Fuja da escravidão antes que ela te alcance - Nesta palestra, Vinícius Teles nos fala a respeito da realidade de muitos trabalhadores que possuem vidas estáveis, porém repletas de frustrações advindas de suas rotinas e carreiras aparentemente seguras. Vinícius trata do empreendedorismo, com dicas para profissionais de tecnologia que buscam atingir não apenas a estabilidade financeira, mas também a plena satisfação profissional e pessoal.

    • Agile Brazil 2012

@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
fractalModule =function(stdlib){
"use asm";
var pow = stdlib.Math.pow;
var abs = stdlib.Math.abs;
var atan2 = stdlib.Math.atan2;
var cos = stdlib.Math.cos;
var sin = stdlib.Math.sin;
function mandlebrot(cx, cy, maxIter) {
cx = +cx;
cy = +cy;
@larrybolt
larrybolt / cf-ddns.sh
Last active April 29, 2024 13:34
Automatically update your CloudFlare DNS record to the IP, Dynamic DNS for Cloudflare
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
# Automatically update your CloudFlare DNS record to the IP, Dynamic DNS
# Can retrieve cloudflare Domain id and list zone's, because, lazy
# Place at:
# /usr/local/bin/cf-ddns.sh
@guifromrio
guifromrio / nodejs-ubuntu-bind-port-80.md
Last active January 10, 2024 22:47
Allow Node.js to bind to privileged ports without root access on Ubuntu

How to: Allow Node to bind to port 80 without sudo

TL;DR

Only do this if you understand the consequences: all node programs will be able to bind on ports < 1024

sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/node

Important: your node location may vary. Use which node to find it, or use it directly in the command:

@debasishg
debasishg / gist:8172796
Last active March 15, 2024 15:05
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&amp;rep=rep1&amp;t
@tlindig
tlindig / colorConversion.js
Last active November 21, 2016 16:24
Functions to convert color values. rgb/rgba, hex and hsv/hsva programmatic. Color keyword, hsl/hsla and rgb with percentage values with help of browser.
/*!
* color conversion
*
* Copyright (c) 2014 Tobias Lindig, Germany
* http://tlindig.de
* License: MIT
*/
var __rgx_strictRgbX = /^(?:rgb|rgba)\s*\(\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})(?:,\s*([0|1]|0?\.\d+))?\s*\)/i; // don't accept % values
var __rgx_isHex = /^#/;
var __rgx_hex3 = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;