Skip to content

Instantly share code, notes, and snippets.

@renz45
renz45 / Preferences.sublime-settings
Created June 1, 2012 16:37
Default Sublime text 2 user settings
{
// calculates indentation automatically when pressing enter
"auto_indent": true,
// sets the colors used within the text area (default)
"color_scheme": "Packages/Color Scheme - Default/Solarized (Dark).tmTheme",
// useful to block endings and closing tags
"draw_indent_guides": true,
@renz45
renz45 / Solarized (Dark).tmTheme
Created July 27, 2012 20:39
Change the color of sublime text trailing spaces. Requires trailing spaces extension.
<dict>
<key>name</key>
<string>Invalid - Illegal</string>
<key>scope</key>
<string>invalid.illegal</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#333333</string>
<key>fontStyle</key>
@renz45
renz45 / gist:3424757
Created August 22, 2012 11:47
Complete exercises for a user
u = User.find(123)
# complete all exercises in level 1
Exercise.all.each {|e| u.user_exercises.find_or_create_by_exercise_id(e.id).complete! if e.lab_id < 2 }
@renz45
renz45 / error.sh
Created October 4, 2012 12:47
nodjitsu error
arduino_socket_server git:(master) ✗ jitsu deploy
info: Welcome to Nodejitsu renz45
info: jitsu v0.9.8
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in app.js
error: Error running command deploy
error: UNABLE_TO_VERIFY_LEAF_SIGNATURE
error: Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE
error: at SecurePair.<anonymous> (tls.js:1312:32)
let(:user) { Factory :user }
let!(:plan) { Factory :subscription_plan, code: HallPass::PLAN_CODE, price: 0 }
let!(:hall_pass) { Factory(:inactive_hall_pass) }
it 'should' do
..do something
end
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input, textarea, p, blockquote, th, td {
margin: 0;
padding: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
fieldset, img {
border: 0;
class User < ActiveRecord::Base
def welcome
send_welcome_email(self)
enable_welcome_tour(self)
enable_welcome_promotion(self)
end
private
def send_welcome_email(user)
@renz45
renz45 / .file
Created February 27, 2014 13:03
atom, command line file/directory open
alias atom="open -a /Applications/atom.app"
@renz45
renz45 / toolTip.coffee
Created June 17, 2014 14:14
An example of wrapping the Twitter Bootstrap tooltip function in a directive to be used within an angular project. Note the `scope.$on '$destroy'` part that cleans up the tooltip and prevents memory leaks.
angular.module('myApp').directive 'tooltip', ->
restrict: 'A'
scope: {}
link: (scope, element, attrs)->
$(element).tooltip({
animation: attrs.animation
html: attrs.html
placement: attrs.placement
selector: attrs.selector
title: attrs.title
@renz45
renz45 / CombatMouseLock.ahk
Last active August 29, 2015 14:06
Autohotkey script that changes wildstar controls to be like tera (asian action rpg style)
;;; CombatMouseLock
;;; v1
;;; 9/6/2014
;;;
;;; Combat mouse lock attempts to recreate a jrpg style of play
;;; comparable to the game Tera. This differs from combing plugins
;;; like steer and mousebindings in that we don't get the clunkiness
;;; of rebinding the mouse buttons, so objects remain selectable
;;; without triggering the bound abilities. The windows key is used
;;; to enguage the lock, while pressing left alt will temporairy