Skip to content

Instantly share code, notes, and snippets.

@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@timcheadle
timcheadle / README.md
Last active January 26, 2023 00:56
Make /robots.txt aware of the Rails environment

Make /robots.txt aware of the Rails environment

You probably don't want Google crawling your development staging app. Here's how to fix that.

$ mv public/robots.txt config/robots.production.txt
$ cp config/robots.production.txt config/robots.development.txt

Now edit config/routes.rb to add a route for /robots.txt, and add the controller code.

@mhluska
mhluska / test.js
Created December 17, 2012 12:22
Compiled JavaScript not being executed. Grunt-requirejs issue: https://github.com/asciidisco/grunt-requirejs/issues/44.
/**
* almond 0.2.3 Copyright (c) 2011-2012, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/almond for details
*/
//Going sloppy to avoid 'use strict' string cost, but strict practices should
//be followed.
/*jslint sloppy: true */
/*global setTimeout: false */
@defunctzombie
defunctzombie / browser.md
Last active July 15, 2024 04:13
browser field spec for package.json
@addyosmani
addyosmani / headless.md
Last active May 17, 2024 03:38
So, you want to run Chrome headless.

Update May 2017

Eric Bidelman has documented some of the common workflows possible with headless Chrome over in https://developers.google.com/web/updates/2017/04/headless-chrome.

Update

If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md

Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.

@mhluska
mhluska / sync-backup-drive.sh
Last active December 17, 2015 18:18
Used with udev to sync a backup drive.
#!/bin/bash
drive_name="${1}"
if [ -z "${drive_name}" ]; then
exit 1
fi
USERNAME='username'
SOURCE_DIR="/home/${USERNAME}/Backup"
@tychobrailleur
tychobrailleur / gist:5712504
Last active July 11, 2020 17:23
Capybara/Selenium/Firefox/Proxy.
require 'capybara/firebug'
# Disable Webmock if needed.
WebMock.disable_net_connect!(allow_localhost: true)
# Same thing for VCR if it has been imported somewhere.
VCR.configure do |c|
c.ignore_localhost = true
end
ENV['NO_PROXY'] = ENV['no_proxy'] = '127.0.0.1'
@iqbalhasnan
iqbalhasnan / carrierwave.rb
Last active May 25, 2023 06:06
carrierwave mini_magick image processing - quality, strip, exif rotation, gaussian blur, interlace
#config/initializers/carrierwave.rb
module CarrierWave
module MiniMagick
# Rotates the image based on the EXIF Orientation
def exif_rotation
manipulate! do |img|
img.auto_orient
img = yield(img) if block_given?
img
end
@mhluska
mhluska / cat.sh
Created April 27, 2014 02:29
How many times have you cat'd a directory?
function cat {
if [ "${#}" -gt 0 -a -d "${1}" ]; then
/bin/ls -l ${*}
else
/bin/cat ${*}
fi
};
@mhluska
mhluska / resume.html
Last active August 29, 2015 14:05
Resume for blog post on syncing resume with LinkedIn profile: http://mhluska.com/blog/2014/08/20/syncing-a-jekyll-blog-resume-with-your-linkedin-profile/
---
layout: layout
title: Resume
---
<!-- resume.html -->
<article class="resume">
<header>
<address>