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
/* | |
* jQuery Templating Plugin | |
* Copyright 2010, John Resig | |
* Dual licensed under the MIT or GPL Version 2 licenses. | |
*/ | |
(function (jQuery, undefined) { | |
var oldManip = jQuery.fn.domManip, tmplItmAtt = "_tmplitem", htmlExpr = /^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /, | |
newTmplItems = {}, wrappedItems = {}, appendToTmplItems, topTmplItem = { key: 0, data: {} }, itemKey = 0, cloneIndex = 0, stack = []; | |
function newTmplItem(options, parentItem, fn, data) { |
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
1. Get the latest nightly rom build from Evervolv at: http://dl.evervolv.com/nightly | |
2. Get the latest Google Apps (Universal Package) from: http://wiki.rootzwiki.com/Google_Apps (see: Jelly Bean Android 4.1.x-4.2.x section of page for download link) | |
3. Restart phone | |
4. Go into Fastboot and then Recovery | |
5. Wipe all partitions (/boot, /cache, /data, /sd-card, etc) | |
6. Connect to computer with roms | |
7. Mount storage and copy them to root | |
8. Choose install from .zip | |
9. Select the evervolv rom | |
10. Boot system up. |
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
#place at top of file | |
$:.unshift(File.dirname(__FILE__)) | |
#this will include the dir context to the same folder as the currently executing script | |
- | |
|-examples | |
|-example1.rb | |
|-lib | |
|-library1.rb |
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
CLI commands for github API v3 (replace all CAPS keywords): | |
git init | |
git add . | |
git commit -am "initial commit" | |
curl -u 'USER:PASS' https://api.github.com/user/repos -d '{"name":"REPO"}' | |
git remote add origin [email protected]:USER/REPO.git | |
git push origin master |
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
Example: | |
class FooController < ApplicationController | |
before_filter :detect_mode | |
def detect_mode | |
@mode = params['mode'] || 'normal' | |
Rails.logger.debug("debug::" + "mode is " + @mode) #note the use of the log filtration token. | |
end |
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
#replace solverforge and ruby ver as needed | |
cd solverforge | |
rvm use jruby | |
rvm gemset create solverforge | |
rvm --create --rvmrc jruby-1.7.2@solverforge | |
#this generates a local .rvmrc specific to the project. |
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
Setting your branch to exactly match the remote branch can be done in two steps: | |
git fetch origin | |
git reset --hard origin/master | |
If you want to save your current branch's state before doing this (just in case), you can do: | |
git commit -a -m "Saving my work, just in case" | |
git branch my-saved-work |
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
var page = new WebPage(), | |
address, output, size; | |
//capture and captureSelector functions adapted from CasperJS - https://github.com/n1k0/casperjs | |
capture = function(targetFile, clipRect) { | |
var previousClipRect; | |
var clipRect = {top: 0, left:0, width: 40, height: 40}; | |
if (clipRect) { | |
if (!isType(clipRect, "object")) { | |
throw new Error("clipRect must be an Object instance."); |
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
#USE IF/ELSE TO SET @config | |
@config ||= if ENV['fb_client_id'] && ENV['fb_client_secret'] && ENV['fb_scope'] && ENV['fb_canvas_url'] | |
{ | |
:client_id => ENV['fb_client_id'], | |
:client_secret => ENV['fb_client_secret'], | |
:scope => ENV['fb_scope'], | |
:canvas_url => ENV['fb_canvas_url'] | |
} | |
else | |
YAML.load_file("#{Rails.root}/config/facebook.yml")[Rails.env].symbolize_keys |
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
apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y |
OlderNewer