start new:
tmux
start new with session name:
tmux new -s myname
class ActiveRecord::Base | |
def can_destroy? | |
self.class.reflect_on_all_associations.all? do |assoc| | |
assoc.options[:dependent] != :restrict || (assoc.macro == :has_one && self.send(assoc.name).nil?) || (assoc.macro == :has_many && self.send(assoc.name).empty?) | |
end | |
end | |
end |
# Det måste vara en tom rad här av någon anledning :) | |
sv: | |
date: | |
formats: | |
default: "%Y-%m-%d" | |
short: "%b %d" | |
long: "%B %d, %Y" | |
day_names: [Söndag, Måndag, Tisdag, Onsdag, Torsdag, Fredag, Lördag] | |
abbr_day_names: [Sön, Mån, Tis, Ons, Tors, Fre, Lör] |
# bash alias | |
alias subl='/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl' | |
# bash function, usage: $ st -p [projectname] -opt2 -opt3 | |
function st() { | |
if [ -n "$1" -a -n "$2" ]; then # if more than one argument | |
if [ "$1" = "-p" -o "$1" = "--project" ]; then # if arg1 is -p or --project | |
local projectfile="$2" | |
[[ $projectfile != *.sublime-project ]] && projectfile="$2.sublime-project" # detect if arg2 already includes the ext | |
if [ -e $projectfile ]; then # does project file exist? |
# Install rvm system-wide | |
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer ) | |
# Update the packages | |
apt-get update | |
apt-get upgrade | |
apt-get install build-essential | |
# get the packages required by ruby | |
rvm pkg install zlib |
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ } | |
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ } | |
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ } | |
@media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ } | |
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ } | |
@media (min-width:1281px) { /* hi-res laptops and desktops */ } |
webpack --display-modules | awk '{print $3$4" "$2}' | grep -v bytes | sort -n | tail -100 |
// Sticky Nav Component | |
var Sticky = (function() { | |
'use strict'; | |
var CSS_CLASS_ACTIVE = 'is-fixed'; | |
var Sticky = { | |
element: null, | |
position: 0, | |
addEvents: function() { |