agnoster.zsh-theme
A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
#!/usr/bin/env ruby | |
require 'active_record' | |
ActiveRecord::Base.establish_connection( | |
:adapter => 'sqlite3', | |
:database => ':memory:' | |
) | |
ActiveRecord::Schema.define do |
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
A ZSH theme optimized for people who use:
For Mac users, I highly recommend iTerm 2 + Solarized Dark
/*jshint browser:true */ | |
/*global DS:true, io:true, App:true */ | |
(function() { | |
'use strict'; | |
// Initializer for Models | |
window.Models = {}; | |
console.warn("Don't pollute the global namespace with Models!"); |
require 'delegate' | |
# Because of using guid ids for the nested attributes we should define | |
# custom permit method. By default strong_parameters accept only numeric | |
# keys for the nested attributes in the fields_for form. | |
# Usage: | |
# params[:app][:nested_attributes] = NestedAttributesParameters.new(params[:app][:nested_attributes]( | |
# params.require(:app).permit(:nested_attributes => [:id, :attribute1, :attribute2] => { '51e52eb101790c31ba000001' => { 'id' => '51e52eb101790c31ba000001', 'attribute1' => 'value1', 'attribute2' => 'value2' } } } |
#!/usr/bin/env sh | |
echo "Creating a self-signed certificate..." | |
openssl req -new -newkey rsa:2048 -sha1 -days 3650 -nodes -x509 -subj "/C=US/ST=Georgia/L=Atlanta/O=BNR/CN=localhost.ssl" -keyout config/server.key -out config/server.crt | |
if ! grep -q "\blocalhost\.ssl\b" /private/etc/hosts; then | |
echo "Adding localhost.ssl to your hosts file..." | |
echo "127.0.0.1 localhost.ssl" | sudo tee -a /private/etc/hosts | |
fi |
#!/usr/bin/env sh | |
CURRENT_ENV=${RACK_ENV:-development} | |
# For the payment gateway callback URL | |
if [ "$CURRENT_ENV" == "development" ]; then | |
PORT_SSL=$(expr $PORT + 1) | |
echo "starting an SSL tunnel from :$PORT_SSL --(--)--> :$PORT" | |
bundle exec tunnels $PORT_SSL 0.0.0.0:$PORT & | |
fi |
class Module | |
def dispatch(*klasses, last) | |
last_klass, mid = last.first | |
klasses << last_klass | |
__dispatch_list << [klasses, instance_method(mid)] | |
define_method(mid, __dispatch_proc(__dispatch_list)) | |
end | |
def __dispatch_list | |
@__dispatch_list ||= [] |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Single-Column Responsive Email Template</title> | |
<style> | |
@media only screen and (min-device-width: 541px) { | |
.content { |
importScripts('spark-md5.min.js'); | |
function calcMD5(f) { | |
var blobSlice = Blob.prototype.slice; | |
var chunkSize = 2097152; | |
var chunks = Math.ceil(f.size/chunkSize); | |
var spark = new SparkMD5.ArrayBuffer(); | |
var currentChunk = 0; | |
var fr = new FileReader(); |