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| # 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) |
| #!/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 |
| # 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 |
| <!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"; |
| require 'uri' | |
| require 'net/protocol' | |
| require 'byebug' | |
| class Request | |
| VERBS = { | |
| get: 'GET' | |
| } |
| package sri | |
| import ( | |
| "crypto/sha256" | |
| "encoding/base64" | |
| "fmt" | |
| "io/ioutil" | |
| ) | |
| func Generate256(file string) (string, error) { |
| defmodule Expng do | |
| defstruct [:width, :height, :bit_depth, :color_type, :compression, :filter, :interlace, :chunks] | |
| def png_parse(<< | |
| 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, | |
| _length :: size(32), | |
| "IHDR", | |
| width :: size(32), | |
| height :: size(32), |
| require 'oat/adapters/hal' | |
| class BooticAdapter < Oat::Adapters::HAL | |
| def type(*types) | |
| property :_class, *types | |
| end | |
| def curie(link_opts) | |
| data[:_links][:curies] ||= [] | |
| data[:_links][:curies] << link_opts | |
| end |