Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
#
# Originally from https://gist.github.com/IanVaughan/2902499
#
# authors: Ian Vaughan
# Jacob Zimmerman
#
# usage: uninstall_gems [<version> ...]
#
# examples:
@searls
searls / gist:a644a89017022912b2c6
Last active August 29, 2015 14:11
Some thoughts on small teams and headquarters HQs

This is a simple little note I wrote down when talking to another company owner on the topic of moving a fully distributed team (with some folks in the same city) to a mostly-distributed team with an HQ office in a single city. It's not necessarily useful as general advice beyond that

why thoughtful physical location matters

I often advise clients that are actively focused on improving their teams to either embrace a fully-distributed team or a fully-colocated one, and to avoid other permutations of organization. Patterns that I see a lot:

  • small satellite offices off a large HQ
  • a handful of remote folk off a large HQ
  • n similarly-sized engineering offices
#!/bin/bash
# Install sleepwatcher
cd /tmp
curl -O http://www.bernhard-baehr.de/sleepwatcher_2.2.tgz
tar -zxvf sleepwatcher_2.2.tgz
cd sleepwatcher_2.2
sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8
sudo cp sleepwatcher /usr/local/sbin
sudo cp sleepwatcher.8 /usr/local/share/man/man8
sudo cp config/de.bernhard-baehr.sleepwatcher-20compatibility.plist /Library/LaunchAgents
@mikepack
mikepack / 1_inheritance.rb
Last active August 29, 2015 14:07
5 Composition Techniques
class Animal
def run
puts 'running'
end
end
Animal.new.run #=> running
class Wolf < Animal
def follow_pack
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
@yohhoy
yohhoy / ffmpeg_tb.md
Last active April 10, 2023 07:36
time-base in FFmpeg

https://www.ffmpeg.org/doxygen/trunk/dump_8c_source.html#l00454

  • fps = st->avg_frame_rate
  • tbr = st->r_frame_rate
  • tbn = st->time_base
  • tbc = st->codec->time_base

AVStream::avg_frame_rate

Average framerate.

  • demuxing: May be set by libavformat when creating the stream or in avformat_find_stream_info().
  • muxing: May be set by the caller before avformat_write_header().
@krisbulman
krisbulman / countCSSRules.js
Last active August 25, 2022 19:53 — forked from psebborn/countCSSRules.js
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE. — This snippet has been modified to count more than just the first level of CSSStyleRule objects within CSSMediaRule.
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
irb(main):002:0> require 'bigdecimal'
=> true
irb(main):003:0> v = BigDecimal("7.1762")
=> #<BigDecimal:7f8905213dc0,'0.71762E1',18(18)>
irb(main):004:0> v.truncate(2).to_s('F')
=> "7.17"
irb(main):005:0> w = BigDecimal("4.2")
=> #<BigDecimal:7f890522c5f0,'0.42E1',18(18)>
irb(main):006:0> w.truncate(2).to_s('F')
=> "4.2"
@kyletolle
kyletolle / gist:9939366
Created April 2, 2014 17:51
RubyProf outline
RubyProf.start
# Code to profile...
result = RubyProf.stop
# Print a graph to an HTML file, sorted by time spend in children.
File.open('profile_output.html', 'w') do |file|
printer = RubyProf::GraphHtmlPrinter.new result
printer.print(file, sort_method: :children_time)
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active April 18, 2024 16:07
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName