Skip to content

Instantly share code, notes, and snippets.

View somebox's full-sized avatar
⌨️
coding nights

Jeremy Seitz somebox

⌨️
coding nights
View GitHub Profile
@somebox
somebox / backbone.rails.js
Created June 30, 2011 10:42 — forked from trydionel/backbone.rails.js
Makes Backbone.js with Rails+CSRF
//
// Backbone.Rails.js
//
// Makes Backbone.js play nicely with the default Rails setup, i.e.,
// no need to set
// ActiveRecord::Base.include_root_in_json = false
// and build all of your models directly from `params` rather than
// `params[:model]`.
//
// Load this file after backbone.js and before your application JS.
@somebox
somebox / waffle-recipe.md
Last active October 20, 2017 11:24
Waffle Recipe

Waffle Making for Engineering Teams

ricardo team waffles

The art of making waffles is very similar to the challenges in team software development. Things have to be prepared on time, and instructions have to be followed. The mixing and cooking seem fairly simple, but it's a repetative and unforgiving task, and in the end you have to ship.

As a one-person exercise, it's fairly easy. But when you scale things up, it gets complicated. Several people working together cannot simply "make waffles". They have to coordinate and divide up the work. And to make waffles for a lot of people, you need multiple waffle irons, mixing stations, and serving.

The challenge for a team is how to organize themselves into assembly steps. At one station, some engineers melt the butter, crack eggs, and mix things. At the same time, another group prepares the dry ingredients, measuring properly. The output of the two streams mus

#!/usr/bin/ruby
# logs in to iTunes connect, downloads the day's report file and saves it in proper csv format.
# by Jeremy Seitz ~ http://fozworks.com
#
# REQUIRES Mechanize GEM:
# sudo gem install mechanize
require 'rubygems'
require 'mechanize'
require 'logger'
@somebox
somebox / unicorn-graphite.rb
Created November 12, 2013 13:03
Graphing unicorn active/queued processes (via sockets)
#!/usr/bin/env ruby
require 'rubygems'
require 'raindrops'
require 'statsd'
#
# This script monitors the active and queued unicorn processes.
# It uses the raindrops gem to look at the unix domain socket.
# Stats are polled every second (for one minute) and pushed to
# statsd as a counter. This script runs once a minute.
function debug(){
if (typeof console != "undefined"){
if (console.log){
if (arguments.length == 1){
console.log(arguments[0]);
} else {
console.log(arguments);
}
}
}
@somebox
somebox / jquery.disable.js
Created September 20, 2011 11:42
jQuery snippet to make page elements unselectable (disable highlights)
/* disable user selections */
jQuery.fn.disableSelection = function(){
$(this).each(function(){
$(this).attr('unselectable', 'on')
.css('-moz-user-select', 'none')
.each(function() {
this.onselectstart = function() { return false; };
});
});
@somebox
somebox / README
Created September 20, 2011 23:47 — forked from indirect/README
Update WebKit nightly
To use this:
1. check out the gist somewhere
2. edit the plist to contain the path to the .rb file
3. run this:
chmod +x update-webkit.rb
launchctl load com.indirect.update-webkit.plist
@somebox
somebox / tamedia-freelance.md
Last active October 30, 2016 12:47
Tamedia Digital - Freelance Outreach

Tamedia Digital - Freelance Opportunities

Jeremy Seitz, Tamedia Core Engineering, Oct 2016

About Tamedia Digital and Core Engineering

Tamedia is the company behind many well-known online Swiss brands, such as 20min, Starticket, Ricardo, Doodle, Homegate, and many others. Core Engineering is a small expert tech consulting group that serves these companies, working closely with engineering teams across the company. Through project work, architecture, training, events, and providing resources, we help the companies of Tamedia bring speed and agility to their engineering efforts.

A Growing Freelance Network

One of the functions of Core Engineering is to build relationships with freelancers and tech agencies in Switzerland. We make it easier for freelancers to work with the different companies in Tamedia, through close collaboration, simplifying contract and billing processes, more flexible placement, access to services and resources, and communication with key contacts across the organizatio

@somebox
somebox / redis-graphite.sh
Last active July 18, 2016 00:37
graphite-redis : monitor redis statistics with graphite across several hosts
#!/usr/bin/env ruby
require 'socket'
# This script runs every minute, captures stats about redis
# and forwards them to graphite as counter values.
# Graphite/carbon settings
GRAPHITE_HOST="graphite.intra.local.ch"
GRAPHITE_PORT=8125
@somebox
somebox / why_utc.md
Last active March 9, 2016 11:09
Why use UTC for DB, APIs, Services... in Switzerland?
  • UTC is best practice http://stackoverflow.com/questions/2532729/daylight-saving-time-and-time-zone-best-practices
  • DST changes can causes issues with things like opening hours, publication dates on contracts, etc... UTC helps avoid this
  • embrace the pattern: UTC on systems and APIs, TZ display in UI/UX and outputs
  • integrations with partners, 3rd-party services (think Amazon, Google Cloud computing, pub/sub services, filepicker... all will use UTC)
  • you trade "easier to think about" for "subtle bugs and weird test fails" in the future
  • people assuming we're standard UTC like the rest of the world might set up servers/services in CEST and be off by an hour (past example: localina!)
  • someday you will work for a company that does things outside of Switzerland. You should learn this :)