Skip to content

Instantly share code, notes, and snippets.

View zerowidth's full-sized avatar

Nathan Witmer zerowidth

View GitHub Profile
@sentientmonkey
sentientmonkey / test-logging.rb
Last active December 15, 2015 04:09
hourly log rotation in ruby logger via rotatelogs
#!/usr/bin/env ruby
require 'logger'
# rotatelogs required...
# http://httpd.apache.org/docs/2.2/programs/rotatelogs.html
logger = Logger.new("|rotatelogs ./foo.log.%Y-%m-%d-%H 3600", 0, 0)
10.times do
logger.error "testing..."
The right side of my brain helps me make things rhyme
The left side keeps it all in time
Whats in between helps me learn and perceive
But do I Believe,
I have the answers I need?
Ours is a culture with pride in logic and reason
But do the ones and zeros truly have meaning
Does your software have feelings?
Stay Tuned
#! /usr/bin/env ruby
require 'rubygems'
require 'main'
require 'pathname'
require 'fileutils'
Main{
argument("youtube_url")
@bkeepers
bkeepers / twithubbers.sh
Created June 4, 2013 14:29
Create a list of GitHubbers and follow all of them.
#!/bin/sh
#
# Requires the `t` gem: https://github.com/sferik/t
#
# gem install t
#
if [ -z $(t lists | grep -i githubbers) ]
then
t list create GitHubbers

Reciprocal Needs in the Employment Relation

We can look at two sides of the management coin: What do the individuals get out of it? And what benefit does the whole system derive from it?

I will disregard any benefits that accrue to managers just by holding the position of managing. Those are just circular logic. Circular logic abounds in discussions of management and hierarchy. For example, consider status reports. It will be said that status reports are necessary so managers know what their employees are working on. It’s

@isaacsanders
isaacsanders / agenda.md
Created January 2, 2013 02:43
An agenda for a recent meeting.

#Council of Chiefs

9:00PM November 3, 2012

Camp Lazarus
4422 Columbus Pike
Delaware, OH 43015

Goal of the Meeting: To make decisions regarding the specifics of Conclave 2013

@bazzargh
bazzargh / hacker.rb
Created November 13, 2015 21:45
hackertyper style presentation tool, leverages ttyrec to let you play back the presentation from random keystrokes
#!/usr/bin/env ruby
# hackertyper-style playback of series of tty recordings created by
# ttyrec.
#
# usage:
# hacker slides/*
#
# - Type randomly to move forward inside file
# - backspace to skip back or prev file
@tmm1
tmm1 / sample.gif
Last active December 11, 2020 07:40
View Profiler
sample.gif
Ruby 2.1.0 in Production: known bugs and patches
Last week, we upgraded the github.com rails app to ruby 2.1.0 in production.
While testing the new build for rollout, we ran into a number of bugs. Most of
these have been fixed on trunk already, but I've documented them below to help
anyone else who might be testing ruby 2.1 in production.
@naruse I think we should backport these patches to the ruby_2_1 branch and
release 2.1.1 sooner rather than later, as some of the bugs are quite critical.
I'm happy to offer any assistance I can to expedite this process.
@mislav
mislav / procs-vs-lambda.md
Last active March 26, 2021 18:34
Jim Weirich on the differences between procs and lambdas in Ruby

Jim Weirich:

This is how I explain it… Ruby has Procs and Lambdas. Procs are created with Proc.new { }, lambdas are created with lambda {} and ->() {}.

In Ruby 1.8, proc {} creates lambda, and Ruby 1.9 it creates procs (don't ask).

Lambdas use method semantics when handling parameters, procs use assignment semantics when handling parameters.

This means lambdas, like methods, will raise an ArgumentError when called with fewer arguments than they were defined with. Procs will simply assign nil to variables for arguments that were not passed in.