As configured in my dotfiles.
start new:
tmux
start new with session name:
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
var rotate = Ti.UI.create2DMatrix().rotate(90); | |
var counterRotate = rotate.rotate(-180); | |
var scrollView = Titanium.UI.createScrollableView({ | |
views:[ | |
Titanium.UI.createImageView({ image:'default_app_logo.png', transform: counterRotate }), | |
Titanium.UI.createImageView({ image:'KS_nav_ui.png', transform: counterRotate }), | |
Titanium.UI.createImageView({ image:'KS_nav_views.png', transform: counterRotate }) |
connection = Faraday::Connection.new('http://example.com') do |builder| | |
builder.request :url_encoded # for POST/PUT params | |
builder.adapter :net_http | |
end | |
# same as above, short form: | |
connection = Faraday.new 'http://example.com' | |
# GET | |
connection.get '/posts' |
cachedImageView = function(basedir, uri, obj, attr, cacheage) { | |
/** | |
Appcelerator Titanium ImageView /w cache | |
This function attempts to cache a remote image and then returns it again | |
when it's requested. | |
The file is stored in a directory "basedir," this is to try and help | |
you keep files unique. It's not special or magical, but not dirty either. |
/* | |
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/ | |
* Better handling of scripts without supplied ids. | |
* | |
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function. | |
*/ | |
(function(doc, script) { | |
var js, | |
fjs = doc.getElementsByTagName(script)[0], |
# 0 is too far from ` ;) | |
set -g base-index 1 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi | |
set -g history-limit 10000 |
package com.yelp.android.ui.widgets; | |
import com.yelp.android.R; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.PorterDuff; | |
import android.graphics.PorterDuffXfermode; |
#!/usr/bin/ruby | |
# Require: | |
# - linux or Mac | |
# - ruby 1.8.7 | |
# - Gem soap4r | |
# - curl | |
# | |
# Usage : | |
# ruby ovhfact.rb 2011 | |
# |
As configured in my dotfiles.
start new:
tmux
start new with session name:
$(function () { | |
"use strict"; | |
// for better performance - to avoid searching in DOM | |
var content = $('#content'); | |
var input = $('#input'); | |
var status = $('#status'); | |
// my color assigned by the server | |
var myColor = false; |