This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh -C myproductionhost.com "sudo -u postgresuser PASSWORD="password" pg_dump production_database_name" | psql local_database_name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ApplicationHelper | |
def responsive_image_tag(image, options = {}) | |
content_tag(:picture) do | |
concat content_tag(:source, nil, media: '(max-width: 768px)', srcset: image.url(:thumbnail_mobile)) | |
concat content_tag(:source, nil, media: '(max-width: 960px)', srcset: image.url(:thumbnail_tablet)) | |
concat image_tag(image.url(:thumbnail_desktop), options) | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Allow cloning repositories using shortcuts. | |
# For example: | |
# git clone gh:attilagyorffy/foo | |
[url "[email protected]:"] | |
insteadOf = gh:// | |
pushInsteadOf = "github:" | |
pushInsteadOf = "git://github.com/" | |
[url "git://github.com/"] | |
insteadOf = "github:" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Shamelessly stolen from http://blog.jeansebtr.com/post/36590722386/async-loading-of-githubs-gists-without-jquery-31-loc | |
* | |
* Use like this: <gist data-username="brandonb927" data-id="4138162" data-file="gists2.js"><a href="https://gist.github.com/brandonb927/4138162#file_gists2.js">Gist</a></gist> | |
* UPDATED 02/06/2013: Github implemented Namespaced Gists a few hours ago, which means gist.github.com/4149074 now redirects to gist.github.com/brandonb927/4149074 and I have updated the gist to reflect this new format | |
* | |
*/ | |
(function(){ | |
var gists = document.getElementsByTagName('gist'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Things may stop working as you upgrade the version of node on your system. | |
# Using Homebrew's alternative repo (homebrew/versions) offers you legacy | |
# and earlier versions of formulae. | |
brew remove node --force | |
brew tap homebrew/versions | |
brew install homebrew/versions/node6-lts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Surviving a major #FreeBSD Upgrade: | |
1) Add your /etc under git | |
2) # freebsd-update upgrade -r 11.0-RELEASE | |
3) Review changes | |
4) # pkg-static install -f pkg | |
5) # pkg upgrade -y | |
6) # freebsd-update install | |
Win. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Taken from ~/Library/Logs/puma-dev.log | |
! Booted app 'testing' on socket /Users/attila/.puma-dev/testing/tmp/puma-dev-19549.sock | |
fish: Could not return shell to foreground | |
tcsetpgrp: Inappropriate ioctl for device | |
fish: Could not return shell to foreground | |
tcsetpgrp: Inappropriate ioctl for device | |
Could not send job 4 ('echo "begin; $argv "\n" ;end <&3 3<&-" | source 3<&0') to foreground | |
tcsetpgrp: Inappropriate ioctl for device | |
Could not send job 4 ('echo "begin; $argv "\n" ;end <&3 3<&-" | source 3<&0') to foreground |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AddFirstAndLastNameToUsers < ActiveRecord::Migration | |
def change | |
add_column :users, :first_name, :string, null: false | |
add_column :users, :last_name, :string, null: false | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git clone https://github.com/attilagyorffy/freebsd.git /usr/src | |
# cd /usr/src | |
# git checkout releng/10.3-libressl | |
# make buildworld && make buildkernel && make installkernel && make installworld | |
# reboot |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# make buildworld | |
-------------------------------------------------------------- | |
>>> World build started on Sun Jun 26 14:42:26 UTC 2016 | |
-------------------------------------------------------------- | |
-------------------------------------------------------------- | |
>>> Rebuilding the temporary build tree | |
-------------------------------------------------------------- | |
rm -rf /usr/obj/usr/src/tmp | |
rm -rf /usr/obj/usr/src/lib32 |