Skip to content

Instantly share code, notes, and snippets.

@grobie
grobie / install_ruby_patch.sh
Created May 31, 2011 16:00
Install ruby-head (1.9.3) and patch `require`
# Install ruby-head (1.9.3) and patch `require`
#
# using: rvm and homebrew
# update dependencies
brew install libyaml readline
# update rvm
rvm get head
rvm reload
@grobie
grobie / gist:1040325
Created June 22, 2011 15:20
google code issue template
What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?
What version of Sequel Pro are you using? What version of MySQL are you
connecting to on the server?
<!DOCTYPE html>
<!--[if IE]>
<![endif]-->
<html><head><meta charset="utf-8" />
<title>Flickermood by Forss on SoundCloud - Create, record and share your sounds for free</title>
<meta content="record, sounds, share, sound, audio, tracks, music, soundcloud" name="keywords" />
<meta content="Listen to Flickermood by Forss: From the Soulhack album,&amp;nbsp;recently featured in this ad &lt;a href=&quot;https://www.dswshoes.com/tv_commercial.jsp?m=october2007&quot;&gt;https://www... | Create, record and share the sounds you create anywhere to friends, family and the world with SoundCloud, the world's largest community of sound creators." name="description" />
<meta content="width=device-width" name="viewport" />
<meta content="chrome=1" name="X-UA-Compatible" />
Read only mode
--------------
- Write tests
- Clock.parse
- connection_error (integration test)
- integration tests
- with_consistency accepts string clock
- raise MasterUnavailable in all cases
- connection stack usage
class MyController
validate :username => String,
:permalink => String,
:user => {
:age => Fixnum,
:numbers => Array
}
:on => :update
def update
#!/usr/bin/env ruby
require 'ipaddr'
# Creates a regexp of trusted IP addresses to be used by Rails'
# ActionController::Request::TRUSTED_PROXIES.
#
class TrustedProxyRegexpCreator
OCTET = '\d{1,3}'
EDGECAST_IP_FORMAT = /#{OCTET}\.#{OCTET}\.#{OCTET}\.(\*|#{OCTET})/
#
# Author:: Tobias Schmidt (<ts@soundcloud.com>)
# Copyright:: Copyright (c) 2013 SoundCloud, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0

Ubuntu on MBP Retina

This is very short and incomplete. Just a few Do's and Dont's

  • Follow the first install instructions of any of the available tutorials ([one example][1])
  • Instead of installing wifi packages manually (I ran into lot's of dependency problems), just use bluetooth tethering and install everything with apt-get/aptitude)
  • no need to decrypt the OSX partition, I was able to enter a new number in the disk manager and resize it without problems
  • To detect encrypted HFS+ partitions you need to change the rEFInd settings: TODO
  • sound was working out of the box
  • I had lot's of problems with the nvidia graphic card and eventually "fixed" them by disabling the card altogether and only using the integrated intel chip. Use gfxCardStatus (version MUST be <= 2.2.1 I think) on osx, configure "integrated only"). later on, you can disable the card in linux with echo OFF &gt; /sys/kernel/debug/vgaswitcheroo/switch as root.
@grobie
grobie / metrics.json
Created November 6, 2013 05:46
Test run of tsenart/vegeta against the prometheus/client_ruby rack example app.
[{
"baseLabels": {
"name": "http_requests_total"
},
"docstring": "A counter of the total number of HTTP requests made",
"metric": {
"type": "counter",
"value": [{
"labels": {
"method": "GET"
@grobie
grobie / dns-split.go
Last active February 2, 2016 09:24
small experiment to split internal/public DNS requests
package main
import (
"flag"
"fmt"
"log"
"net"
"strings"
"github.com/miekg/dns"