This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Backbone event binding works very well. It is possible to remove listeners from specific context without specifying a named function | |
*/ | |
//set up model | |
var Ork = Backbone.Model.extend({ | |
defaults:{ says: "Waaaaaagh" } | |
}); | |
var o = new Ork(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[[[UIAlertView alloc] initWithTitle:@"Alert Title" | |
message:"Message" | |
delegate:self | |
cancelButtonTitle:@"Cancel" | |
otherButtonTitles:nil, nil] autorelease] show]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# model file | |
class SimpleModel extends Backbone.Model | |
# view file | |
class SimpleView extends Backbone.View | |
# click listener | |
onClick: -> | |
@model.trigger("selected") | |
# spec file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# prompt | |
# | |
alias ls='ls -G' | |
# Stuff for git | |
parse_git_branch () { | |
git branch 2> /dev/null | grep "*" | sed -e 's/* \(.*\)/ (\1)/g' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/paperclip_processors/add_copyright_exif.rb | |
# Requires: | |
# gem paperclip | |
# gem mini_exiftool | |
# exiftool (command line util) | |
module Paperclip | |
class AddCopyrightExif < Paperclip::Processor | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# ...other config ..... | |
# | |
# include all headers | |
for root, dirs, files in os.walk("./"): | |
if any("*.h" or "*.hpp" in files): | |
flags.append("-I") | |
flags.append(os.path.join(root)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fileutils' | |
require 'securerandom' | |
# | |
# all files must match cengage file names | |
# | |
def cengagify_files folder_path | |
Dir.glob("#{folder_path}/**/*").each do |f| | |
# skip directories and simple names | |
next if File.directory?(f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#~/.local/share/nautilus/scripts/copy-full-path.sh | |
#! /bin/bash | |
echo $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS | clipit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- How to embed Roboto locally --> | |
<!-- see instructions here: http://tumult.com/hype/documentation/2.0/fonts/ --> | |
<!-- download files from Google (google it) --> | |
<style> | |
/* base face */ | |
@font-face { | |
font-family: 'Roboto', Arial, Helvetica; | |
src: url('${resourcesFolderName}/Roboto-Regular.ttf') format('truetype'); |
OlderNewer