Skip to content

Instantly share code, notes, and snippets.

View Anticom's full-sized avatar
:octocat:
octocode

Timo Mühlbach Anticom

:octocat:
octocode
View GitHub Profile
@jeetsukumaran
jeetsukumaran / custom_iterator.cpp
Created February 18, 2010 02:33
Sample C++/STL custom iterator
// Sample custom iterator.
// By perfectly.insane (http://www.dreamincode.net/forums/index.php?showuser=76558)
// From: http://www.dreamincode.net/forums/index.php?showtopic=58468
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cassert>
@tlrobinson
tlrobinson / google-translate-drums.js
Created November 30, 2010 06:19
A drum machine for the German Google Translate. See instructions in comments below.
(function() {
// Notes from http://news.ycombinator.com/item?id=1952531
var notes = {
"suspended cymbal":"zk",
"snare":"bschk",
"brush":"pv",
"bass":"bk",
"flam1":"tk",
"roll tap":"vk",
"flam2":"kt",
@garethr
garethr / build.xml
Created March 20, 2011 15:07
Sample ant build file for running rsync and scp base flat file deployment
<project name="{{ name }}" default="help" basedir=".">
<property name="username" value="{{ username }}"/>
<property name="host" value="{{ host }}"/>
<property name="dir" value="/srv/{{ path }}/"/>
<tstamp>
<format property="TODAY_UK" pattern="yyyyMMddhhmmss" locale="en,UK"/>
</tstamp>
@ne-sachirou
ne-sachirou / Math.uuid.js
Created March 22, 2011 22:08
Math.uuid.js #js
// Copyright (c) 2010 Robert Kieffer
// http://www.broofa.com
// mailto:robert@broofa.com
// Copyright (c) 2011 http://c4se.sakura.ne.jp/profile/ne.html
// Dual licensed under the MIT and GPL licenses.
(function() {
var CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''),
random;
@pksunkara
pksunkara / config
Last active June 29, 2024 11:23
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
@neolitec
neolitec / Color.js
Created November 7, 2011 10:19
Javascript Color Class
var Color = function() {
this.r = this.g = this.b = 0;
this.h = this.s = this.l = 0;
this.a = 1;
};
/** RGB */
Color.prototype.cssRGB = function() {
return "rgb("+Math.round(255*this.r)+","+Math.round(255*this.g)+","+Math.round(255*this.b)+")";
};
Color.prototype.cssRGBA = function() {
@masak
masak / explanation.md
Last active June 18, 2024 08:24
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 29, 2024 08:12
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jukworks
jukworks / gist:4037243
Created November 8, 2012 06:34
A Sample Code: Getting a Real FFT of 1D array using jTransform library.
import edu.emory.mathcs.jtransforms.fft.DoubleFFT_1D;
public class FftTest {
public static void main(String[] args) {
double[] input = new double[]{
0.0176,
-0.0620,
0.2467,
0.4599,
-0.0582,
@hggh
hggh / graylog2.md
Last active January 6, 2023 12:18
Graylog2 Debian Packages

WARNING

These packages are obsolete! Please use the official packages from http://www.Graylog2.org

=================================================