Skip to content

Instantly share code, notes, and snippets.

View jlindsey's full-sized avatar
🐢

Josh Lindsey jlindsey

🐢
View GitHub Profile
require 'spec_helper'
describe "Routing to the default RESTful endpoints for Users" do
before(:each) do
@id = rand(1..1_000).to_s
end
it "does not route to an index action" do
expect(:get => '/v1/users').not_to be_routable
end
docker -d -D -g /var/lib/docker -H unix:// -H tcp://0.0.0.0:4243
from i3pystatus import IntervalModule
from subprocess import check_output, check_call
class Backlight(IntervalModule):
settings = required = (
("format",)
)
def run(self):
output = float(bytes.decode(check_output("xbacklight")).strip())
#!/bin/sh
exec 2>&1
export PULSE_LATENCY_MSEC=60
export LD_PRELOAD="/usr/lib/i386-linux-gnu/mesa/libGL.so.1"
exec /usr/bin/skype

Keybase proof

I hereby claim:

  • I am jlindsey on github.
  • I am jlindsey (https://keybase.io/jlindsey) on keybase.
  • I have a public key whose fingerprint is 2853 0A17 C9A3 EE88 78AD 3E96 94A3 EBC6 477F 6909

To claim this, I am signing this object:

# -*- coding: utf-8 -*-
""" Watchdog script for reconfiguring and restarting nginx"""
import time
import os
import signal
from subprocess import check_output
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
o8o .o
`"' .d88
oooo oooo ooo oooo ooo. .oo. .ooooo. .d'888 ooo. .oo. .oo. .ooooo.
`88. `88. .8' `888 `888P"Y88b d88' `88b .d' 888 `888P"Y88bP"Y88b d88' `88b
`88..]88..8' 888 888 888 888ooo888 88ooo888oo 888 888 888 888ooo888
`888'`888' 888 888 888 888 .o 888 888 888 888 888 .o
`8' `8' o888o o888o o888o `Y8bod8P' o888o o888o o888o o888o `Y8bod8P'
description "Unicorn Server"
author "Josh Lindsey <josh@entrenextmobile.com>"
start on stopped cloud-init
stop on runlevel [01456]
respawn
respawn limit 10 5
oom never
worker_processes ENV['RAILS_ENV'] == 'production' ? 4 : 2
timeout 45
preload_app true
listen '/tmp/unicorn.sock', :backlog => 1024
pid '/tmp/unicorn.pid'
user 'wine4me', 'wine4me'
before_fork do |server, worker|
[1] pry(main)> class Josh
[1] pry(main)* attr_accessor :x
[1] pry(main)* end
=> nil
[2] pry(main)> j = Josh.new
=> #<Josh:0x007ff8c2f4b650>
[3] pry(main)> j.x = { foo: 'bar' }
=> {:foo=>"bar"}
[4] pry(main)> jj = j.dup
=> #<Josh:0x007ff8c2bfaf00 @x={:foo=>"bar"}>