Skip to content

Instantly share code, notes, and snippets.

View okertanov's full-sized avatar

Oleg Kertanov okertanov

View GitHub Profile
@schacon
schacon / example_gist_create.rb
Created August 6, 2008 20:29
gist example api post
require 'net/http'
require 'uri'
# /api/v1/:format/new
# /api/v1/:format/gists/:user
# /api/v1/:format/:gist_id
res = Net::HTTP.post_form(URI.parse('http://gist.github.com/api/v1/xml/new'),
{ 'files[file1.ab]' => 'CONTNETS',
'files[file2.ab]' => 'contents' })
/* gcc -o nostdlib nostdlib.c -m32 -z execstack -nostdlib */
/* Who needs libc or asm() when you can abuse the ABI in horrible ways?*/
typedef int (*sc_fun)(int,int,int,int,int,int,int);
void _start(void) {
char syscall[] = "\x60\x83\xc4\x24\x58\x5b\x59\x5a\x5e\x5f\x5d\xcd\x80\x83\xec\x40\x61\xc3";
((sc_fun)syscall)(4, 0, "Hello, World\n", 13, 0, 0, 0);
((sc_fun)syscall)(1, 0, 0, 0, 0, 0, 0);
}

(a gist based on the old toolmantim article on setting up remote repos)

To collaborate in a distributed development process you’ll need to push code to remotely accessible repositories.

This is somewhat of a follow-up to the previous article setting up a new rails app with git.

For the impatient

Set up the new bare repo on the server:

@iamFIREcracker
iamFIREcracker / .Xmodmap
Created April 10, 2011 11:47
A snippet for Xmodmap that will teach you to use the correct shift keys.
remove shift = Shift_R
remove lock = Caps_Lock
remove mod5 = Mode_switch
add control = Caps_Lock
add mod3 = Mode_switch
keysym Shift_R = Mode_switch
A VC funded Broadway troop is looking for a senior Drama Queen with
at least 3 years of Ruby experience.
Must have skills:
* Strong record of bitching on Twitter
* HAML, SASS, RSpec
* Wasting time on rubyinside.com daily is a must
* Must have NO experience with concurrency. Concurrency is for Erlang & JVM old farts.
* 2 days of experience with rbenv
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@jboner
jboner / latency.txt
Last active July 22, 2024 00:16
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
@ckirkendall
ckirkendall / clojure-match.clj
Created June 15, 2012 02:26 — forked from bkyrlach/Expression.fs
Language Compare F#, Ocaml, Scala, Clojure, Ruby and Haskell - Simple AST example
(use '[clojure.core.match :only [match]])
(defn evaluate [env [sym x y]]
(match [sym]
['Number] x
['Add] (+ (evaluate env x) (evaluate env y))
['Multiply] (* (evaluate env x) (evaluate env y))
['Variable] (env x)))
(def environment {"a" 3, "b" 4, "c" 5})
@jwilling
jwilling / gist:4186817
Last active March 5, 2023 22:01
Lets help improve AppKit.

Is AppKit causing you frustration? Instead of just complaining about it, lets try to make it better by compiling a list of specific problems with AppKit. Leave a comment below, and I'll include it in the list.


##NSView##

  • NSView does not have the ability to set an affine transform (rdar://15608609)
  • Controls that have cells (such as NSTextField) do not respond properly when layer-backed. Take NSButton as an example. When not layer-backed, it will animate properly using the animator proxy. When layer-backed, using the animator proxy breaks focus rings (they jump to destination immediately). Currently, directly manipulating the layer of a cell-based control is not supported (and will lead to a broken interface), but is much needed. (rdar://15608822)

##NSViewController##

  • NSViewController could be more useful. It has -loadView but no other lifecycle methods. (rdar://15608948)