Skip to content

Instantly share code, notes, and snippets.

View gms8994's full-sized avatar

Glen Solsberry gms8994

View GitHub Profile
@gms8994
gms8994 / gist:10548482
Created April 12, 2014 18:00
keybase.md
### Keybase proof
I hereby claim:
* I am gms8994 on github.
* I am gms (https://keybase.io/gms) on keybase.
* I have a public key whose fingerprint is 304F CBA9 8265 50E1 2FF7 5B07 A90A F690 B812 799C
To claim this, I am signing this object:
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:web) do
execute "curl -qX POST -H 'authorization: abcd1234' http://www.example.com/_token"
end
end
task :migrate_install do
@gms8994
gms8994 / hey.rb
Last active August 29, 2015 14:23 — forked from quad/hey.rb
#!/usr/bin/env ruby
#
# hey! a minimalist CRM for http://todotxt.com/
#
# hey tells you one thing you should do regularly, but haven't done lately.
#
# $ todo.sh lf hey
# 1 @phone Mom (+1 234 567 8901) +family
# 2 @skype Dad +family
# 3 @email mentor
@gms8994
gms8994 / app-Http-Controllers-MainController.php
Last active August 29, 2015 14:25
Argument 1 passed to App\Http\Controllers\MainController::search() must be an instance of Illuminate\Http\Request, instance of Symfony\Component\HttpFoundation\Request given
<?php
namespace App\Http\Controllers;
use App\Models\Program;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class MainController extends Controller {
@gms8994
gms8994 / 1.php
Created April 26, 2011 19:52
Benchmark Comparison
<?php
class Test {
public function test() {
return "abcd1234";
}
}
@gms8994
gms8994 / cdn_tester.sh
Created May 17, 2011 14:17
curl timer fetch stackexchange CDNs
#!/bin/bash
REPEAT=20
TIMER=0
function fetchTimer {
URL=$1
CURRENT_TIME=`curl --compressed -w '%{time_total}' -o /dev/null -s $URL`;
TIMER=`echo "$CURRENT_TIME + $TIMER" | bc`
<?xml version='1.0' encoding='UTF-8'?>
<accounts type='array'>
<account>
<id>44283</id>
<name></name>
<event-feed-uri>/events.rss</event-feed-uri>
<applications type='array'>
<application>
<id type='integer'>156463</id>
<name>NetworldAlliance</name>
May 30 08:55:13.470 [12381] dbg: logger: adding facilities: all, bayes, learn, dns
May 30 08:55:13.470 [12381] dbg: logger: logging level is DBG
May 30 08:55:13.470 [12381] dbg: generic: SpamAssassin version 3.3.2
May 30 08:55:13.470 [12381] dbg: generic: Perl 5.010001, PREFIX=/usr/local, DEF_RULES_DIR=/usr/local/share/spamassassin, LOCAL_RULES_DIR=/etc/mail/spamassassin, LOCAL_STATE_DIR=/var/lib/spamassassin
May 30 08:55:13.470 [12381] dbg: config: timing enabled
May 30 08:55:13.471 [12381] dbg: config: score set 0 chosen.
May 30 08:55:13.474 [12381] dbg: util: running in taint mode? yes
May 30 08:55:13.474 [12381] dbg: util: taint mode: deleting unsafe environment variables, resetting PATH
May 30 08:55:13.474 [12381] dbg: util: PATH included '/home/glens/bin', keeping
May 30 08:55:13.474 [12381] dbg: util: PATH included '/usr/local/bin', keeping
@gms8994
gms8994 / sql2xls.pl
Created July 25, 2012 14:07
Executes SQL commands against server; uploads results to Google Spreadsheets
#!/usr/bin/perl
# Allows the user to take the result of a series of SQL queries
# and place them in Google docs, so that data can be easily shared
# Author: Glen Solsberry <http://dp.cx/blog>
# Copyright: Public Domain
use warnings;
use strict;
@gms8994
gms8994 / gasmask_focus_mode
Created October 17, 2012 17:53 — forked from axelav/gasmask_focus_mode
Gasmask focus mode
0.0.0.0 twitter.com
0.0.0.0 mail.google.com
0.0.0.0 facebook.com
0.0.0.0 www.facebook.com
0.0.0.0 nytimes.com
0.0.0.0 www.nytimes.com
0.0.0.0 news.ycombinator.com
0.0.0.0 stellar.io
0.0.0.0 www.stellar.io