This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Do *not* load any libs here that are *not* part of Ruby’s standard-lib. Ever. | |
| desc "Install all dependencies" | |
| task :bootstrap do | |
| if system('which bundle') | |
| sh "bundle install" | |
| sh "git submodule update --init" | |
| # etc | |
| else | |
| $stderr.puts "\033[0;31m[!] Please install the bundler gem manually: $ [sudo] gem install bundler\e[0m" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # | |
| # Adam Sharp | |
| # Aug 21, 2013 | |
| # | |
| # Usage: Add it to your PATH and `git remove-submodule path/to/submodule`. | |
| # | |
| # Does the inverse of `git submodule add`: | |
| # 1) `deinit` the submodule | |
| # 2) Remove the submodule from the index and working directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/sbin/dtrace -s | |
| /* | |
| * newproc.d - snoop new processes as they are executed. DTrace OneLiner. | |
| * | |
| * This is a DTrace OneLiner from the DTraceToolkit. | |
| * | |
| * 15-May-2005 Brendan Gregg Created this. | |
| */ | |
| /* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| json = JSON.parse(`plutil -convert json -o - "#{filename}"`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Runs a specified shell command in a separate thread. | |
| # If it exceeds the given timeout in seconds, kills it. | |
| # Returns any output produced by the command (stdout or stderr) as a String. | |
| # Uses Kernel.select to wait up to the tick length (in seconds) between | |
| # checks on the command's status | |
| # | |
| # If you've got a cleaner way of doing this, I'd be interested to see it. | |
| # If you think you can do it with Ruby's Timeout module, think again. | |
| def run_with_timeout(command, timeout, tick) | |
| output = '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'openssl' | |
| OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'json' | |
| require 'ostruct' | |
| require 'pp' | |
| str = { woo: [ 1, 2, 3], yay: { foo: true, bar: ["42", 2, {}] } }.to_json | |
| pp JSON.parse(str, object_class: OpenStruct).yay.bar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| ) | |
| type MyString string | |
| func (s MyString) plusa() MyString { | |
| return s + "a" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Some notes on remote debugging mac builds on Travisci. It's hard to tell when something hangs what the cause it. Trial and error via commits is tedious. And on Mac , sometimes it's the gui asking for input. So I worked my around to get the access I needed for faster debugging a build. | |
| ################################################# | |
| # Enable remote ssh access to travisci build for debugging | |
| ################################################# | |
| # Add a key so we can login to travisci vm | |
| - cat ssh/travisci.pub >> ~/.ssh/authorized_keys | |
| - chmod 600 ssh/travisci | |
| # Install netcat |