Skip to content

Instantly share code, notes, and snippets.

@connormckelvey
connormckelvey / 0_reuse_code.js
Created February 12, 2014 15:40
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@connormckelvey
connormckelvey / .functions
Last active August 29, 2015 13:56
Bash Function for adding new aliases
#add alias
function newalias() {
echo alias $1=\"$2\" >> ~/.aliases
source ~/.bash_profile
}
@connormckelvey
connormckelvey / hostname.bookmarklet
Created March 20, 2014 19:30
Copy Hostname from Chrome
Simple JS Bookmarket to let you quicly copy just the hostname of a url. Chrome hides http:// in the url which makes it hard to easily copy and paste a hostname. If you use a shell or ftp client a lot you know what I am talking about. Here is the script:
javascript:void(
function(){var u = window.location.hostname.replace(/^www\./,'');
window.prompt('Copy URL to Clipboard CMD/CTRL + C',u);
}()
);
@connormckelvey
connormckelvey / o
Created April 4, 2014 17:51
open directory name as website in default browser
function o() {
result=${PWD##*/}
open 'http://'$result
}
[blocked] The page at 'https://schema.org/address' was loaded over HTTPS, but ran insecure content from 'http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js': this content should also be loaded over HTTPS.
address:1
[blocked] The page at 'https://schema.org/address' was loaded over HTTPS, but ran insecure content from 'http://www.google.com/jsapi': this content should also be loaded over HTTPS.
address:1
[blocked] The page at 'https://schema.org/address' was loaded over HTTPS, but ran insecure content from 'http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js': this content should also be loaded over HTTPS.
address:1
Uncaught ReferenceError: $ is not defined address:18
[blocked] The page at 'https://schema.org/address' was loaded over HTTPS, but ran insecure content from 'http://www.google.com/jsapi': this content should also be loaded over HTTPS.
address:1
Uncaught ReferenceError: google is not defined address:67
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :private_network, ip: "192.168.33.21"
" Remap :W to :w
command W w
+command Wq wq
" Better mark jumping (line + col)
nnoremap ' `
/* ========================================================================
* DOM-based Routing
* Based on http://goo.gl/EUTi53 by Paul Irish
*
* Only fires on body classes that match. If a body class contains a dash,
* replace the dash with an underscore when adding it to the object below.
*
* .noConflict()
* The routing is enclosed within an anonymous function so that you can
* always reference jQuery with $, even when in .noConflict() mode.
@connormckelvey
connormckelvey / gist:97d56bed872ecaa6ea00
Created August 6, 2014 16:12
Take Screenshots of Website
#!/bin/bash
PAGES=("http://www.example.com/"
"http://www.example.com/about.aspx"
"http://www.example.com/blog/"
"http://www.example.com/blog/?page=1")
for ((i = 0; i < ${#PAGES[@]}; i++))
do
webkit2png ${PAGES[$i]} --fullsize
done
#!/bin/bash
PAGES=(
"http://www.example.com"
"http://www.example.com/home"
"http://www.example.com/about"
)
for ((i = 0; i < ${#PAGES[@]}; i++))
do
webkit2png ${PAGES[$i]} --fullsize