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
package sri | |
import ( | |
"crypto/sha256" | |
"encoding/base64" | |
"fmt" | |
"io/ioutil" | |
) | |
func Generate256(file string) (string, error) { |
require 'uri' | |
require 'net/protocol' | |
require 'byebug' | |
class Request | |
VERBS = { | |
get: 'GET' | |
} |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Conditional Get</title> | |
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> | |
<script> | |
$(document).ready(function() { | |
var theResource = "dump.zip"; |
# we'll use 2 processors/core | |
worker_processes 2; | |
# we set a new limit for open files for our workers | |
worker_rlimit_nofile 100000; | |
# we define how we're going to work | |
events { | |
# for each worker we'll handle 4000 requests (enquee them) | |
worker_connections 4000; | |
# we'll accept multiple |
#!/usr/bin/env bash | |
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz | |
mkdir vim && tar xzvf vim.tar.gz -C vim | |
export PATH=$PATH:/app/vim/bin |
# This file is used by Rack-based servers to start the application. | |
require ::File.expand_path('../config/environment', __FILE__) | |
class MyMiddleware | |
def initialize(app) | |
@app = app | |
end | |
def call(env) |
# Other syntax without patch | |
STUDENT_LEVELS = { | |
freshman: Student::Underclassman, | |
sophomore: Student::Underclassman, | |
junior: Student::Upperclassman, | |
senior: Student::Upperclassman, | |
graduate: Student::Graduate | |
}.tap { |h| h.default = Student::Unregistered } | |
def count_nodes(label) | |
before = ObjectSpace.count_objects | |
yield | |
after = ObjectSpace.count_objects | |
puts " #{label} created T_NODE: %d" % (after[:T_NODE] - before[:T_NODE]) | |
end | |
class MyClass | |
include Enumerable |