| ⌘T | go to file |
| ⌘⌃P | go to project |
| ⌘R | go to methods |
| ⌃G | go to line |
| ⌘KB | toggle side bar |
| ⌘⇧P | command prompt |
| source "http://rubygems.org" | |
| gem 'sprockets', :git => 'git://github.com/sstephenson/sprockets.git' | |
| gem 'coffee-script' | |
| gem 'sass' | |
| gem 'rack-test' | |
| gem 'sinatra' |
| javascript:(function(g,d,f){if(f)d.info("Session found:",f);else return d.warn("No session found!");var h={check:10,wait:500},b=g.autodj={api:g[f],available:function(a){return b.api.taken_dj_map[a]<0},spot:function(){return b.api.become_dj.data("spot")},become:function(a){b.api.callback("become_dj",a)},waiter:function(a){return function(){return b.available(a)?(b.become(a),a):(d.info("Waiting..."),-1)}},seated:function(a){return b.api.djs[a]&&b.api.djs[a][0]===b.api.myuserid},wait:function(a,c){var e=c!==void 0, | |
| a=a||h.check,c=c||b.spot();b.seated(c)?d.warn("Spot",c,"taken!"):(e&&d.error("Spot",c,"missed. Restarting..."),d.info("Polling @",a,"ms"),b.check(a,b.waiter(c)))},check:function(a,c){setTimeout(function(){var e=c.call(b);e>0?(d.warn("Spot",e,"open..."),setTimeout(function(){b.wait(a,e)},h.wait)):b.check(a,c)},a)}}})(window,console,function(g,d,f,h,b,a,c,e,i,j,k){try{return g(d)[f](h)[b][a][c][e]()[i](j)[k]}catch(l){return null}}(jQuery,".invite_dj","data","events","click",0,"handler","toString","match |
| <script src="ender.min.js"></script> | |
| <script> | |
| $.require('/js/core.min.js', 'core') | |
| $.ready('core', function () { | |
| $(document).ready(function () { | |
| $('<p>hello world</p>').appendTo('body') | |
| .bind('click', function (e) { | |
| $.require('/js/ajax.min.js', function () { |
##Setup Textmate for Rails Dev on OS X
This guide was written by Jon Kinney for the Green Bay Ruby User Group. Jon works at Intridea and they graciously sponsor the Green Bay RUG meetings.
These guides were also partially completed using time from Intridea's SparkTime initiative which aims to give employees "outside projects" to work on during their normal work week.
If you find any issues with these suggestions please let me know. I've amassed these tips/tricks over several years of full time Rails development using Textmate but just because it works on my system doesn't always mean it will be problem free universally. Thanks to all the blog authors whose articles helped me learn Textmate over the years but whose links/posts I've lost or forgotten over time. If you have a cool Textmate tip or trick please post it in the comments!
| function getDominantColor(aImg) { | |
| let canvas = document.createElement("canvas"); | |
| canvas.height = aImg.height; | |
| canvas.width = aImg.width; | |
| let context = canvas.getContext("2d"); | |
| context.drawImage(aImg, 0, 0); | |
| // keep track of how many times a color appears in the image | |
| let colorCount = {}; |
| function( | |
| a, // a object holding test functions | |
| b, // a logging function, taking multiple arguments | |
| c, // placeholder | |
| d, // placeholder | |
| e, // placeholder | |
| f // placeholder | |
| ){ | |
| c = d = e = 0; // initialize asserts, failures and exception counts to 0 | |
| for ( // iterate |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
| // Basic XMPP bot example for HipChat using node.js | |
| // To use: | |
| // 1. Set config variables | |
| // 2. Run `node hipchat_bot.js` | |
| // 3. Send a message like "!weather 94085" in the room with the bot | |
| var request = require('request'); // github.com/mikeal/request | |
| var sys = require('sys'); | |
| var util = require('util'); |
| /*! | |
| * SSSL: smallest, simpelst script loader | |
| * version: 1.0.1 | |
| * | |
| * API: | |
| * Normal usage | |
| * sssl(source [,complete]); | |
| * | |
| * Example: | |
| * sssl('jquery.js', function(){ |