Skip to content

Instantly share code, notes, and snippets.

View colinta's full-sized avatar
🏠
Working from home

Colin T.A. Gray colinta

🏠
Working from home
View GitHub Profile
@colinta
colinta / Default (Linux).sublime-keymap
Created January 10, 2012 19:27 — forked from optilude/Default (OS X).sublime-keymap - User
A version of the Sublime Text 2 plugin at http://www.sublimetext.com/forum/viewtopic.php?f=5&t=2260&start=0 that makes for TextMate-like clipboard history
[
{ "keys": ["ctrl+x"], "command": "clipboard_manager_cut" },
{ "keys": ["ctrl+c"], "command": "clipboard_manager_copy" },
{ "keys": ["ctrl+v"], "command": "clipboard_manager_paste", "args": { "indent": true } },
{ "keys": ["ctrl+ctrl+v"], "command": "clipboard_manager_paste", "args": { "indent": false } },
{ "keys": ["ctrl+alt+v"], "command": "clipboard_manager_next_and_paste" },
{ "keys": ["ctrl+shift+v"], "command": "clipboard_manager_previous_and_paste" },
@colinta
colinta / bookstore.py
Created April 16, 2012 17:21 — forked from chroto/bookstore.py
SA Bookstore
"""
# Bookstore
- Book => Images
- Book <=> Author
- Book <=> Genre
- Book -> Genre (Primary)
@colinta
colinta / gist:2864117
Created June 3, 2012 16:42 — forked from Cosmo/gist:2864098
css dsl for rubymotion
# Inline styles
@calculate_button = UIButton.named(I18n.t(:calculate_button)).style(color: 0xFFFFFF, align: :center, vertical_align: :center, top: 10, left: 30, width: 120, height: 40)
# External styles
# /app/stylesheets/application.rb
class ApplicationStylesheet < Stylesheets::Base
# Stylesheets for UI-Elements
# usage: @element.outfit(:awesome_default)
Teacup::Stylesheet.new(:iphone) do
# enable orientations on the root view
style do
left 0
top 0
width 320
height 480
backgroundColor :lightyellow.uicolor
portrait true
class SubmitButton < UIButton
def self.make(params={})
# return instance of SubmitButton (or any subclass)
@submitButton = self.buttonWithType(UIButtonTypeRoundedRect)
@submitButton.frame = params[:frame]
# defaults
@submitButton.titleLabel.font = UIFont.systemFontOfSize(14)
@submitButton.titleLabel.text = "Submit"
@submitButton.titleLabel.backgroundColor = UIColor.grayColor
@colinta
colinta / gist:4716202
Last active December 12, 2015 04:39 — forked from Ferdev/gist:4716131
class Symbol
def ivar
"@#{self}"
end
end
foo.instance_variable_set(:name.ivar, value)
Teacup::Stylesheet.new :create_screen do
# Input Fields
style :input_text_wrapper,
left: 24,
backgroundColor: UIColor.colorWithPatternImage(UIImage.imageNamed('ui-textfield-normal.png')),
userInteractionEnabled: true,
width: 249
style :input_text_type,
Teacup::Stylesheet.new :main do
style :my_style,
constraints: [
constrain_left(0),
constrain_width(100),
constrain_top(0),
constrain(:bottom).equals(:superview, :bottom),
]
end
layout do
@table_holder = subview(UIView, :table) do
@table = subview(UITableView,
frame: [[50,300],[500, 400]],
dataSource: self,
delegate: self
)
end
end
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront