Skip to content

Instantly share code, notes, and snippets.

View evanscottgray's full-sized avatar
🤠
herding cats

Evan Gray evanscottgray

🤠
herding cats
View GitHub Profile
@evanscottgray
evanscottgray / task_scheduler.rb
Created September 3, 2014 21:54
simple scheduler, put this into config/initializers/something.rb, add rufus-scheduler to your gemfile, and bam, tasks.
scheduler = Rufus::Scheduler.new
def do_something
puts 'Something.'
end
scheduler.every "24h", :first_at => Time.now do
do_something
end
@evanscottgray
evanscottgray / php.md
Created September 17, 2014 14:09
php

I can’t even say what’s wrong with PHP, because— okay. Imagine you have uh, a toolbox. A set of tools. Looks okay, standard stuff in there. You pull out a screwdriver, and you see it’s one of those weird tri-headed things. Okay, well, that’s not very useful to you, but you guess it comes in handy sometimes. You pull out the hammer, but to your dismay, it has the claw part on both sides. Still serviceable though, I mean, you can hit nails with the middle of the head holding it sideways. You pull out the pliers, but they don’t have those serrated surfaces; it’s flat and smooth. That’s less useful, but it still turns bolts well enough, so whatever. And on you go. Everything in the box is kind of weird and quirky, but maybe not enough to make itcompletely worthless. And there’s no clear problem with the set as a whole; it still has all the tools. Now imagine you meet millions of carpenters using this toolbox who tell you “well hey what’s the problem with these tools? They’re all I’ve ever used and they work fine!

@evanscottgray
evanscottgray / gist:045c49c646cc032acd61
Created September 30, 2014 21:51
cincstats restart
docker ps | grep cincstats | awk {'print $1'} | xargs docker stop || : && docker run -d -p 8080:3030 cincstats/deploy:latest
@evanscottgray
evanscottgray / ezpz.js
Created October 7, 2014 22:12
ezpz.js
var linearScale = d3.scale.linear()
.domain([d3.min(dataset, function (f) {return parseInt(f.total);}), d3.max(dataset, function (f) {return parseInt(f.total);})])
.range([0, 100]);
var svgContainer = d3.select("#select").append('svg')
.attr("width", 1000)
.attr("height", 1000)
.style("border", "black solid 1px");
var svgCircles = svgContainer.selectAll("circle")
@evanscottgray
evanscottgray / report.txt
Last active August 29, 2015 14:07
Sastemic Cloud Costs
Usage Stats for Item #0.
Hours Used: 267.33
Hourly Price: 0.022
Total Cost for Month: 5.88
Usage Stats for Item #1.
Hours Used: 267.35
Hourly Price: 0.022
Total Cost for Month: 5.88
@evanscottgray
evanscottgray / appl.json
Created October 22, 2014 03:39
apple bid price over time...
[
"97.85",
"98.27",
"98.48",
"98.58",
"98.52",
"98.52",
"98.47",
"98.50",
"98.50",
@evanscottgray
evanscottgray / allthecontainers.md
Created October 29, 2014 22:10
delete docker containers

delete all the docker containers! docker ps -a | sed '1d' | awk {'print $1'} | xargs docker rm

@evanscottgray
evanscottgray / weechat.md
Last active August 29, 2015 14:09
weechat wow

Getting your WeeChat on.

Boot a Fedora 22 Cloud Server.

We'll need to install these things:

mosh
weechat
tmux
vim
@evanscottgray
evanscottgray / rackspace_config.rb
Created December 28, 2014 00:19
fog paperclip wow rackspace cloud files
RACKSPACE_CONFIG = {
'production' => {
path: '',
storage: :fog,
fog_credentials: {
provider: 'Rackspace',
rackspace_username: ENV['RACKSPACE_USERNAME'],
rackspace_api_key: ENV['RACKSPACE_API_KEY'],
persistent: false
},
function getProgress() {
$.ajax({
dataType: "json",
url: '/progress'
})
.done(function (data) {
var total = data.total;
var current = data.current;
var percentage = (current / total * 100);
$('.progress .progress-bar').width(percentage + '%');