Skip to content

Instantly share code, notes, and snippets.

View isa's full-sized avatar
☀️
Working, whatd'ya think..

Isa Goksu isa

☀️
Working, whatd'ya think..
View GitHub Profile
@isa
isa / gist:2571012
Created May 1, 2012 20:10
Convert in less than 30 lines
Question: Convert following into the latter data structure in less than 30 lines:
List:
A, B, C
A, C, E
E, F, D
D, A, J
E, D, J
List
@isa
isa / gist:2590709
Created May 4, 2012 00:35 — forked from paulwoods/gist:1142106
gradle - exclude files from a jar.
jar {
manifest {
attributes "Implementation-Title": "Gradle Quickstart"
attributes "Implementation-Version": version
attributes "Main-Class" : "com.ti.specteam.programs.Application"
}
// remove the security files (from mail.jar / activation.jar) so that the jar will be executable.
@isa
isa / gist:2699078
Created May 15, 2012 04:16
TextMate 2 .tm_properties

This is all based on the [alpha release][1].

Properties

From the built-in help system:

For many settings TextMate will look for a .tm_properties file in the current folder and in any parent folders (up to the user’s home folder).

These are simple setting = value listings where the value is a format string in which other variables can be referenced.

@isa
isa / gist:2707623
Created May 16, 2012 05:09
OSX Say Command
say -v Agnes "hello world"
Female Voices
Agnes - relatively natural female voice
Kathy - sounds like a computer, kind of like the computer voice
Princess – kind of sounds like an old lady
Vicki - most natural, kind of whispery
Victoria – computery sounding
Male Voices
@isa
isa / latency.txt
Created June 1, 2012 03:39 — forked from jboner/latency.txt
Latency numbers every programmer should know
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 25 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 3,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns
@isa
isa / gist:2963073
Created June 21, 2012 00:11
Install PEAR to OSX Lion
sudo php /usr/lib/php/install-pear-nozlib.phar
pear config-set php_ini /private/etc/php.ini
pecl config-set php_ini /private/etc/php.ini
sudo pear upgrade-all
@isa
isa / gist:3016089
Created June 29, 2012 05:51
springmvc-router evaluation
My route file is say:
GET /hello/{id} controller.do
GET /hello controller.dont
public String do(@PathVariable String id) {
// id is 123
@isa
isa / gist:3068581
Created July 7, 2012 23:33
jQuery Even PubSub Example
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Some title</title>
<link rel="stylesheet" href="stylesheets/main.css" type="text/css" />
<script type="text/javascript" charset="utf-8" src="javascripts/modernizr-2.5.3.min.js"></script>
<script type="text/javascript" charset="utf-8" src="javascripts/jquery-1.7.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="javascripts/main.js"></script>
@isa
isa / gist:3735531
Created September 17, 2012 04:22 — forked from xavi/gist:3729307
Fast, simple, powerful templating in Clojure
;; Call the renderer-fn macro with a template and it returns a function optimized to render it.
;; This happens at compile-time.
;; At run-time, you call this function with the parameters that will be interpolated into the template,
;; typically (but not limited to) a map.
;;
;; Useful in i18n for variable interpolation, for example. I'm using this to add internationalization
;; support to https://github.com/xavi/noir-auth-app
;; See usage at the end.
@isa
isa / gist:3850671
Created October 8, 2012 04:09
Syntax highlighting for terminal with pygmentize
#!/usr/bin/env bash
if [ ! -t 0 ];then
file=/dev/stdin
elif [ -f $1 ];then
file=$1
else
echo "Usage: $0 code.c"
echo "or e.g. head code.c|$0"
exit 1