$ rails g model User
belongs_to
has_one
/* Checkbox Hack */ | |
input[type=checkbox] { | |
position: absolute; | |
top: -9999px; | |
left: -9999px; | |
} | |
label { | |
-webkit-appearance: push-button; | |
-moz-appearance: button; |
$(document).ready -> | |
StickTop.initApp() | |
@StickTop = | |
app: | |
initHeaderBinding: (headerSelector)-> | |
$(window).on "scroll", ()-> | |
if $('body').scrollTop() > 65 | |
$(headerSelector).addClass('fixed-to-top') | |
$('.stick-top').slideDown(400) |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
namespace :unicorn do | |
## | |
# Tasks | |
desc "Start unicorn" | |
task(:start) { | |
config = rails_root + "config/unicorn.rb" | |
sh "bundle exec unicorn --daemonize --config-file #{config}" | |
} |
javascript: function failsafe() { | |
if(location.href.indexOf('failsafe')==-1){ | |
if (location.href.indexOf('?') == -1) { | |
location.href = location.href.concat("?failsafe=true"); | |
}else{ | |
location.href = location.href.concat("&failsafe=true"); | |
} | |
} else { | |
var href = location.href.replace("failsafe=true",""); | |
if(location.href.lastIndexOf("&") === location.href.length-1){ |
#!/bin/bash | |
# | |
# Open new Terminal tabs from the command line | |
# | |
# Author: Justin Hileman (http://justinhileman.com) | |
# | |
# Installation: | |
# Add the following function to your `.bashrc` or `.bash_profile`, | |
# or save it somewhere (e.g. `~/.tab.bash`) and source it in `.bashrc` | |
# |
var casper = require("casper").create(); | |
casper.options.waitTimeout = 25000; | |
var url_list = casper.cli.get(0); | |
var fileName = casper.cli.get(1); | |
var result = url_list.split(","); | |
var requests = {}, responses = {}; | |
casper.start().eachThen(result, function(urlData) { | |
casper.thenOpen(urlData.data, function(urlData) { |
!function(t){function e(t,e,a,n){for(var r="",s=0,i=a.length;i>s;s++)r+=n(a[s],e);return"<tr>"+r+"</tr>"}function a(t,e){var a=t.attributeWriter(e),n="<td";return(t.hidden||t.textAlign)&&(n+=' style="',t.hidden&&(n+="display: none;"),t.textAlign&&(n+="text-align: "+t.textAlign+";"),n+='"'),n+">"+a+"</td>"}function n(t){return t[this.id]}function r(e){return t(e).html()}function s(e,a){this.update=function(){var n="",r=a.table.columns,s=a.writers._rowWriter,i=a.writers._cellWriter;e.$element.trigger("dynatable:beforeUpdate",n);for(var o=0,d=a.dataset.records.length;d>o;o++){var u=a.dataset.records[o],l=s(o,u,r,i);n+=l}if(a.features.recordCount&&t("#dynatable-record-count-"+e.element.id).replaceWith(e.recordsCount.create()),a.features.paginate&&(t("#dynatable-pagination-links-"+e.element.id).replaceWith(e.paginationLinks.create()),a.features.perPageSelect&&t("#dynatable-per-page-"+e.element.id).val(parseInt(a.dataset.perPage))),a.features.sort&&r){e.sortsHeaders.removeAllArrows();for(var o=0,d=r.length;d>o;o++) |
th{background:#006a72}th a{color:#fff}th a:hover{color:#fff;text-decoration:underline}.dynatable-search{float:right;margin-bottom:10px}.dynatable-pagination-links{float:right}.dynatable-record-count{display:block;padding:5px 0}.dynatable-pagination-links li,.dynatable-pagination-links span{display:inline-block}.dynatable-page-break,.dynatable-page-link{display:block;padding:5px 7px}.dynatable-page-link{cursor:pointer}.dynatable-active-page,.dynatable-disabled-page{cursor:text}.dynatable-active-page:hover,.dynatable-disabled-page:hover{text-decoration:none}.dynatable-active-page{background:#006a72;border-radius:5px;color:#fff}.dynatable-active-page:hover{color:#fff}.dynatable-disabled-page,.dynatable-disabled-page:hover{background:0 0;color:#999} |