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
# 1) Point *.example.com in your DNS setup to your server. | |
# | |
# 2) Setup an Apache vhost to catch the star pointer: | |
# | |
# <VirtualHost *:80> | |
# ServerName example.com | |
# ServerAlias *.example.com | |
# </VirtualHost> | |
# | |
# 3) Set the current account from the subdomain |
;; dotimes | |
(define-syntax dotimes | |
(syntax-rules () | |
((_ n body ...) | |
(do ((i n (- i 1))) | |
((not (< 0 i))) | |
body ...)))) | |
(dotimes 5 |
import os | |
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes | |
from cryptography.hazmat.primitives import padding | |
from cryptography.hazmat.backends import default_backend | |
backend = default_backend() | |
key = os.urandom(16) | |
text = b'Hello, there!' | |
padder = padding.PKCS7(algorithms.TripleDES.block_size).padder() |
=semantic_form_for [:admin, @dog], validate: true, html: {multipart: true} do |f| | |
=f.inputs do | |
=f.input :name | |
=f.input :kennel_name | |
=f.input :birthdate | |
=f.input :gender, as: :radio, collection: {'Tik' => 'F', 'Hane' => 'M'} | |
=f.input :father_id, as: :select, collection: @dogs | |
=f.input :mother_id, as: :select, collection: @bitches | |
=f.semantic_fields_for :pictures do |pic| |
(defadvice ruby-indent-line (after unindent-closing-paren activate) | |
(let ((column (current-column)) | |
indent offset) | |
(save-excursion | |
(back-to-indentation) | |
(let ((state (syntax-ppss))) | |
(setq offset (- column (current-column))) | |
(when (and (eq (char-after) ?\)) | |
(not (zerop (car state)))) | |
(goto-char (cadr state)) |
--colour | |
-I app |
class Clipboard | |
CopyPaste = Struct.new :copy, :paste | |
def initialize | |
cmds = [['pbcopy', 'pbpaste'], | |
['xclip', 'xclip -o'], | |
['xsel', 'xsel -o']] | |
cmds.map! do |cmd| | |
CopyPaste.new cmd.first, cmd.last |
require 'date' | |
author = "Saito" | |
email = "saitowu@gmail.com" | |
date = Date.new(2012, 7, 30) | |
s = %w{ | |
. . . . . . . | |
. . o o o . . | |
. o . . . . . |