Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nhoag
nhoag / README.md
Last active August 29, 2015 13:59
Acquia SimpleSAMLphp Script
@nhoag
nhoag / incompatible.rb
Last active August 29, 2015 14:08
Scrape Acquia's list of incompatible modules
require 'rubygems'
require 'mechanize'
require 'logger'
require 'nokogiri'
# Create a new mechanize object
mech = Mechanize.new
# Uncomment for verbose output
# mech.log = Logger.new $stderr
@nhoag
nhoag / capybara-cheat-sheet.md
Last active August 29, 2015 14:08 — forked from zhengjia/capybara cheat sheet
Common Capybara code snippets

Navigating

    visit('/projects')
    visit(post_comments_path(post))

Clicking links and buttons

// It is important to declare your variables.
(function() {
var foo = 'Hello, world!';
print(foo); //=> Hello, world!
})();
// Because if you don't, the become global variables.
(function() {
{
"title": "Apache Overview",
"services": {
"query": {
"list": {
"2": {
"id": 2,
"type": "topN",
"query": "",
"alias": "",
{
"title": "Apache logs",
"services": {
"query": {
"list": {
"0": {
"query": "*",
"alias": "",
"color": "#7EB26D",
"id": 0,
  1. General Background and Overview
@nhoag
nhoag / github-trend.sh
Last active October 29, 2015 13:06
Returns a pretty list of trending repos from Github in your terminal
function gh-trend() {
local INTERVAL=${1:-'daily'}
echo -e "Github Trending: $INTERVAL"
curl -s https://github.com/trending\?since=${INTERVAL} \
| xmllint --html --xpath '//h3/a/@href|//p[@class="repo-list-description"]/text()' - 2>/dev/null \
| sed 's#href=\"#\'$'\nhttps://github.com#g' \
| grep -Ev '^[ ]+$' \
| grep -Ev '^$' \
| sed 's/^[ ]*//;s/[ ]*$//;s/\"$//;s/^/* /;s/^* https/\'$'\n\033[0;32mhttps/;s#^* #\\'$'\n\t\033[0m* #'
echo
@nhoag
nhoag / pinboard-popular.sh
Last active October 31, 2015 16:36
Get Popular Items from Pinboard in your terminal