Skip to content

Instantly share code, notes, and snippets.

@bjeavons
bjeavons / done-yesterday
Created May 19, 2015 16:31
Quick script to list what I did yesterday via iDoneThis
#!/bin/bash
# 1)Install jq from http://stedolan.github.io/jq/download/
# 2) Get your username from https://idonethis.com/accounts/settings/account/
# 3) Get your token from https://idonethis.com/api/token/
# 4) Fill out this file and place in your path
URL="https://idonethis.com/api/v0.1/dones/?owner=[USERNAME]&done_date=yesterday"
AUTH="Token [TOKEN]"
@bjeavons
bjeavons / steps.txt
Created February 10, 2015 21:45
steps for changing term background color on any SSH
/*
* How to change background iTerm color on SSH when using fish shell
*/
// Put this in a file, replace RGB color with your current bgcolor. ex: original-bgcolor
tell application "iTerm"
tell the current terminal
tell the current session
set background color to {0,0,0}
end tell
var http = require('http');
var cheerio = require('cheerio');
function parse_feed (content, hook, callback) {
$ = cheerio.load(content);
$('entry').each(function(i, elem) {
hook.debug($(this).find('title').text());
});
callback();
}
@bjeavons
bjeavons / boris-quickstart.md
Created January 9, 2015 21:15
boris quickstart for Drupal magic

You'll need boris and boris-loader and then set a boris bootstrap for your Drupal repos.

Install boris however you prefer. I have a /usr/local/bin/boris symlink to the boris vendor binary under ~/.composer

Install boris-loader. I just cloned the repos to my homedir.

Set up a Drupal bootstrap in your local Drupal dirs.

@bjeavons
bjeavons / keybase.md
Created March 26, 2014 20:33
keybase prove

Keybase proof

I hereby claim:

  • I am bjeavons on github.
  • I am bjeavons (https://keybase.io/bjeavons) on keybase.
  • I have a public key whose fingerprint is 0AEF 8A87 37CB C737 0240 B91A FE7F 71A1 0529 7D50

To claim this, I am signing this object:

@bjeavons
bjeavons / jshijack.html
Last active September 30, 2021 07:00
Testing Javascript hijacking via object overloading.
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge, chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<title>js hijack testing</title>
</head>
<body>
require 'rubygems'
require 'sinatra/base'
class MyApp < Sinatra::Base
disable :protection
get '/' do
g = params[:arg]
t1 = Thread.new do
sleep 4
File.open("data.txt", "a+") do |f|
@bjeavons
bjeavons / localdev.drush.inc
Created June 20, 2012 18:52
bulk delete drupal nodes of a type
<?php
function localdev_drush_command() {
$items = array();
$items['lcld'] = array(
'description' => 'Delete nodes',
'callback' => 'drush_lcld',
'options' => array(
'type' => 'node type',
#!/usr/bin/env bash
CURL="/usr/bin/curl"
GROWL="/usr/local/bin/growlnotify"
URL=$1
CODE=`$CURL -sL -w "%{http_code}" $1 -o /dev/null`
if [ "$CODE" -ne 200 ]
then $GROWL -t "IS DOWN" -m "$URL"
fi
@bjeavons
bjeavons / a-dl-dbs
Created May 31, 2012 15:29
Download database from Acquia for any alias
#!/usr/bin/env bash
# Usage: FILE [site-alias] [file]
# Note: do not provide @ symbol for alias
# e.g.: a-dl-dbs acquiacom.prod prod-insight-insight-2012-05-29.sql.gz
HOST=`drush sa --component=remote-host @$1`
USER=`drush sa --component=remote-user @$1`
scp $USER@$HOST:/mnt/files/$1/backups/$2 $2 && chmod 600 $2