Skip to content

Instantly share code, notes, and snippets.

View dblandin's full-sized avatar

devon blandin dblandin

View GitHub Profile
@dblandin
dblandin / README.md
Created May 12, 2012 01:08
HTML5/JS/CSS Templates

HTML5/JS/CSS Templates w/ Grunt

File structure

./css
  ./css/main.css
./dist
  .all.css
  ./all.js

./fallback

@dblandin
dblandin / JavaCandR.sublime-build
Created June 15, 2012 22:02
Sublime Text 2 Java Build and Run
{
"cmd": ["build_java.sh", "$file_base_name"]
}
@dblandin
dblandin / states.rb
Created June 25, 2012 22:51
Ruby array of US state name and abbreviations
states = Array[ ["AK", "Alaska"],
["AL", "Alabama"],
["AR", "Arkansas"],
["AS", "American Samoa"],
["AZ", "Arizona"],
["CA", "California"],
["CO", "Colorado"],
["CT", "Connecticut"],
["DC", "District of Columbia"],
["DE", "Delaware"],
@dblandin
dblandin / CaesarCipher.java
Created July 25, 2012 03:23 — forked from robbielynch/CaesarCipher.java
Caesar Cipher Command Line Decrypter
public class CaesarCipher {
public static void main(String args[]){
if (args.length == 3)
{
//output decrypted string
System.out.println(decryptString(args[0], args[1], args[2]));
}
else
@dblandin
dblandin / Fraction.m
Created September 15, 2012 09:51
Greatest Common Divisor(GCD) and Least Common Multiple(LCM)
@interface Fraction : NSObject
+(int) gcd: (int) num1:(int) num2;
+(int) lcm: (int) num1:(int) num2;
@end
@implementation Fraction
@dblandin
dblandin / Fraction.h
Created September 15, 2012 09:53
Fraction class
//
// Fraction.h
// FractionCalculator
//
// Created by Devon Blandin on 9/15/12.
// Copyright (c) 2012 Devon Code Shop. All rights reserved.
//
#import <Foundation/Foundation.h>
window.InvitesApp = {
Models: {}
Collections: {}
Views: {}
# Shared regular expressions, largely duplicates of ruby model validations
Regexes:
name: /^[a-z]+[-\w\s\.']*$/i
email: /[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?/
@dblandin
dblandin / activate_tab.applescript
Last active September 29, 2023 16:26
AppleScript to grab a list of tab titles from Google Chrome.
# Activate tab
# $ osascript activate_tab.applescript 1, 2
on run argv
set window_index to item 1 in argv
set target_index to item 2 in argv
tell application "Google Chrome" to set active tab index of first window to target_index
tell application "Google Chrome" to activate
end run
@dblandin
dblandin / Gemfile
Last active December 19, 2015 21:39 — forked from iwarshak/Gemfile
RubyMotion Papertrail Logger
source :rubygems
gem "rake"
gem 'motion-logger' #cocoalumberjack wrapper
@dblandin
dblandin / DSCMultipartUploader.m
Created July 22, 2013 15:53
Inline function build error using RubyMotion 2.4
...
NSString * const ContentStringTypeJPEG = @"image/jpeg";
NSString * const ContentStringTypeVideo = @"video/mp4";
inline NSString *stringFromContentType(DSCMultipartContentType contentType)
{
switch (contentType) {
case DSCMultipartContentJPEG:
return ContentStringTypeJPEG;
break;