Skip to content

Instantly share code, notes, and snippets.

View pepe's full-sized avatar

Josef Pospíšil pepe

View GitHub Profile
@saetia
saetia / gist:1623487
Last active May 1, 2024 19:55
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@jimweirich
jimweirich / froth.rb
Created February 22, 2012 23:24
Stupid Simple Forth System in Ruby
# Example Usage: ruby froth.rb ": sq dup * ; 2 sq ."
class Froth
attr_reader :storage
attr_accessor :trace
WordDefinition = Struct.new(:name, :xt, :immediate)
class WordDefinition
def immediate?
immediate

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@passcod
passcod / Gemfile
Created September 20, 2012 05:15
Padrino + Sidekiq = ♥
# ...
gem 'sidekiq'
# ...
@iperelivskiy
iperelivskiy / hash.js
Created November 19, 2012 14:39
JS simple hash function
var hash = function(s) {
/* Simple hash function. */
var a = 1, c = 0, h, o;
if (s) {
a = 0;
/*jshint plusplus:false bitwise:false*/
for (h = s.length - 1; h >= 0; h--) {
o = s.charCodeAt(h);
a = (a<<6&268435455) + o + (o<<14);
c = a & 266338304;
anonymous
anonymous / shared.rb
Created December 20, 2012 01:51
Shared Juno store Implement your own key value server in 50 lines!
require 'drb'
module Juno
class Shared < Base
def initialize(options = {}, &block)
options[:port] ||= 9000
@uri = options[:uri] || (options[:socket] ? "drbunix://#{options[:socket]}" :
"druby
@snatchev
snatchev / libuv-tcp-client.c
Created March 27, 2013 16:55
a libuv evented tcp client
#include <stdio.h>
#include <uv.h>
static void on_close(uv_handle_t* handle);
static void on_connect(uv_connect_t* req, int status);
static void on_write(uv_write_t* req, int status);
static uv_loop_t *loop;
static uv_buf_t alloc_cb(uv_handle_t* handle, size_t size) {
@dankrause
dankrause / _hover_example.py
Last active March 8, 2024 18:31
Example code to use the (unofficial, unsupported, undocumented) hover.com DNS API.
import requests
class HoverException(Exception):
pass
class HoverAPI(object):
def __init__(self, username, password):
params = {"username": username, "password": password}
r = requests.post("https://www.hover.com/api/login", params=params)
@willurd
willurd / web-servers.md
Last active May 10, 2024 05:14
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000