Skip to content

Instantly share code, notes, and snippets.

View hotwatermusic's full-sized avatar

Vladimir Maslov hotwatermusic

View GitHub Profile
@amjd
amjd / gist:acc5e108bfb2f29f050c
Created June 6, 2014 05:30
List of websites used in Conlectus's WhoAmI - http://tinsnail.neocities.org/
var rawSites = {
'programming': [
'http://blog.codinghorror.com/',
'http://thedailywtf.com/',
'http://www.hanselman.com/blog/',
'http://code.tutsplus.com',
'https://news.ycombinator.com/',
'http://www.reddit.com/r/programming/',
'http://codebetter.com',
'http://android-developers.blogspot.com/',
local function fire()
local beam = {}
for i = 1, 20 do
--Have used circle, but if you use a blurry yellow glow, it would look more like a fire
beam[i] = display.newCircle(0,0,3.5) --display.newImage("glow4.png")--
beam[i].x, beam[i].y = math.random(100,200) , 500
@monperrus
monperrus / Apriori.java
Last active August 11, 2023 11:22
Java implementation of the Apriori algorithm for mining frequent itemsets
import java.io.*;
import java.util.*;
/** The class encapsulates an implementation of the Apriori algorithm
* to compute frequent itemsets.
*
* Datasets contains integers (>=0) separated by spaces, one transaction by line, e.g.
* 1 2 3
* 0 9
* 1 9
@mattetti
mattetti / multipart_upload.go
Last active April 22, 2024 05:24
Example of doing a multipart upload in Go (golang)
package main
import (
"bytes"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"os"
@Prinzhorn
Prinzhorn / example.js
Created June 17, 2013 12:35
Tiny jQuery plugin which makes refreshing elements a breeze.
//Enlarge all the bacon.
$('.bacon').height(10000).refresh();
@kkirsche
kkirsche / Install Composer to use MAMP's PHP.md
Last active January 30, 2024 02:30
How to install Composer globally using MAMP's PHP

##Create an alias to MAMP's PHP installation

To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

Within the terminal, run:

nano ~/.bash_profile

This will open nano with the contents, at the top in a blank line add the following line:

@eendeego
eendeego / launch.sh
Created February 5, 2013 21:39
Launch TopCoder Arena on OS X with Java 7/8
#!/bin/bash
cd `dirname $0`
curl\
--remote-name \
--remote-header-name\
http://www.topcoder.com/contest/arena/ContestAppletProd.jnlp
JAVAWS="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/javaws"
@jboner
jboner / latency.txt
Last active May 2, 2024 09:45
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@ijt
ijt / http_get.go
Last active August 23, 2021 12:37
Example of using http.Get in go (golang)
package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
)