Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@vhbit
vhbit / error_handling.rs
Created June 11, 2014 08:51
Comment on error handling example
fn result_from_option<T, E>(a: Option<T>, f: || -> E) -> Result<T, E> {
match a {
Some(a) => Ok(a),
_ => Err(f())
}
}
fn slurp_file(file: &Path) -> Result<Vec<LabelPixel>, SlurpError> {
use std::{result, option};
let file: File = try!(File::open(file).map_err(|e| FailedIo(e)));
static NSString *SQLNullValueString = [[NSString alloc] initWithString:@"NULL"];
/* Prototypes */
NSString *SQLWhereClauseForPredictate(NSPredicate *predicate);
NSString *SQLExpressionForNSExpression(NSExpression *expression);
/* Implementation */
@vhbit
vhbit / README.md
Last active August 29, 2015 13:57
Russian input method for Dvorak keyboard on Mac

Put ru-mac-dv.el into $SHARE_DIR/emacs/$version/lisp/leim/quail

If Emacs is installed from Homebrew, SHARE_DIR will look like HOMEBREW_DIR/share, which in most cases is either /usr/local/share or ~/homebrew/share

For activation, put the following snippet into your custom.el:

(register-input-method 
   "russian-md" "Russian-Mac Dvorak" 'quail-use-package
   "RU-MD" "ЙЦУКЕН Russian Mac Dvorak layout"

"quail/ru-mac-dv")