Skip to content

Instantly share code, notes, and snippets.

#! /bin/bash
# This script runs on os x.
SITES=( "speedtest-lon1.digitalocean.com" \
"speedtest-sfo1.digitalocean.com" \
"speedtest-ams1.digitalocean.com" \
"speedtest-ams2.digitalocean.com" \
"speedtest-nyc1.digitalocean.com" \
"speedtest-nyc2.digitalocean.com" \
@wesley6j
wesley6j / capybara cheat sheet
Created November 13, 2015 01:13 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@wesley6j
wesley6j / sass-hexagon.scss
Created February 14, 2016 15:58 — forked from bjmiller121/sass-hexagon.scss
SASS Mixin to generate a hexagon in CSS
// Makes a CSS hexagon! based off of http://csshexagon.com/
// Demo: http://sassmeister.com/gist/98fcf3ce163a97d2ef7e
@mixin hexagon($size, $color, $border: 0) {
position: relative;
width: $size;
height: ($size * 0.577);
background-color: $color;
margin: ($size * 0.288) 0;
border-left: $border;
border-right: $border;
module Acts
module Cacheable
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def acts_as_cacheable(key, options = {})
extend Acts::Cacheable::SingletonMethods
find(:all, options).each{|instance| cached_objects[instance.send(key).to_s] = instance}
@wesley6j
wesley6j / pr.md
Created June 29, 2017 13:43 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@wesley6j
wesley6j / fullscreen3.js
Created August 16, 2017 19:21 — forked from simonewebdesign/fullscreen3.js
JavaScript Full Screen API (completely cross-browser!)
// quando clicco su enterfullscreen:
// vai in fullscreen
// all'entrata in fullscreen:
// mostra pulsante exitfullscreen
// nascondi header e footer
// quando clicco su exitfullscreen:
// esci da fullscreen
@wesley6j
wesley6j / google_analytics_turbolinks5.js
Created November 9, 2017 12:24 — forked from Startouf/ google_analytics_turbolinks5.js
Google Analytics for Turbolinks 5 (& Rails 5)
// Google Analytics code to work with Turbolniks 5
this.GoogleAnalytics = (function() {
function GoogleAnalytics() {}
GoogleAnalytics.load = function() {
var firstScript, ga;
window._gaq = [];
window._gaq.push(["_setAccount", GoogleAnalytics.analyticsId()]);
window._gaq.push(['_setAllowAnchor', true]);
@wesley6j
wesley6j / Gemfile
Created January 4, 2018 12:24 — forked from pboling/Gemfile
My latest project's Gemfile, implements bundle group pattern
source 'https://rubygems.org'
# Follows the bundler group pattern described here:
# http://iain.nl/getting-the-most-out-of-bundler-groups
# Gemfile.mine in root dir allows locally custom gems.
# NOTE: Doing this will change the Gemfile.lock - commit with care.
eval File.read(File.join(File.dirname(__FILE__), 'Gemfile.mine')) if File.exists? File.join(File.dirname(__FILE__), 'Gemfile.mine')
ruby '1.9.3'
#!/bin/bash
# linode stackscript to setup a user with my ssh key
# so that I can run ansible provisions
set -e
set -u
adduser --disabled-password --gecos "" my_user
@mixin flag-variant($height, $bg) {
display: block;
background:$bg;
position: relative;
line-height: $height;
font-size: $height*.5;
&::before,
&::after {
content: "";