Skip to content

Instantly share code, notes, and snippets.

View gist:378b55e55a33969634bf
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1
View gist:bef5e23567937a12f5bd
[2014-10-03 11:20:31] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\DBALException: "An exception occurred while executing 'SELECT t0.id AS id1, t0.code AS code2, t0.created AS created3, t0.root AS root4, t0.lvl AS lvl5, t0.lft AS lft6, t0.rgt AS rgt7, t0.parent_id AS parent_id8, t0.discr FROM pim_catalog_category t0 WHERE t0.code = ? AND t0.discr IN ('category') LIMIT 1' with params ["ski_men_jackets"]: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.discr' in 'field list'" at /home/vcap/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 91 {"exception":"[object] (Doctrine\\DBAL\\DBALException: An exception occurred while executing 'SELECT t0.id AS id1, t0.code AS code2, t0.created AS created3, t0.root AS root4, t0.lvl AS lvl5, t0.lft AS lft6, t0.rgt AS rgt7, t0.parent_id AS parent_id8, t0.discr FROM pim_catalog_category t0 WHERE t0.code = ? AND t0.discr IN ('category') LIMIT 1' with params [\"ski_men_jackets\"]:\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.
View gist:25b03858daf16f17c3ef
# Arguments:
#
# $1 is the file
# $2 is the type - for those times when file magic isn't enough.
# I frequently get html mail that has no extension
# and file can't figure out what it is.
#
# Set to '-' if you don't want the type to be discerned.
# Many applications can sniff out the type on their own.
View gist:27990f3fa70dbb1a8b5a
let barposition = "bottom"
set noautofocus "The opposite of autofocus; this setting stops sites from focusing on an input box when they load
set typelinkhints
let locale = "uk"
let hintcharacters = "arstenio"
let completionengines = ["google", "bing"]
let searchalias g = "google" "Create a shortcut for search engines. For example, typing ':tabnew g example' would act the same way as ':tabnew google example'
let mapleader = ","
unmap e
unmap d
View link.coffee
View gist:8d8706ec797211a4e408
MYSQL
When(/^I visit comment page (\d+)$/) do |page|
CacheSweeper.stub(expire_cache: nil)
CommentSweeper.any_instance.stub(clear_cache: nil)
10.times { News::Item.first.comments << FactoryGirl.build(:comment, published: true)
p News::Item.first.comments.where('published = ?', true).page(page).per(Comment.config.per_page).map(&:id)
en
=> [16, 15, 14]
@emileswarts
emileswarts / colours
Created Mar 14, 2012
Display terminal colours
View colours
for i in {0..255}; do printf "\x1b[38;5;${i}mcolor${i}\n"; done
@emileswarts
emileswarts / gist:2198261
Created Mar 25, 2012
Add external screen
View gist:2198261
xrandr --output VGA-0 --auto --left-of LVDS
View gist:2286149
xrandr --output VGA-0 --auto --left-of LVDS --auto
xrandr --output LVDS --mode 1366x768