Skip to content

Instantly share code, notes, and snippets.

View oracle.json
[
{
"Id": "db9d6c0ad3bcc119f7ca1f1164149da7e2c4ff82f3298401cde308d05946d3a6",
"Created": "2018-09-14T20:18:39.885550309Z",
"Path": "/bin/sh",
"Args": [
"-c",
"/usr/sbin/startup.sh && tail -f /dev/null"
],
"State": {
@darrinholst
darrinholst / failure-hooks.js
Created Mar 2, 2017
protractor-cucumber auto screenshot failures
View failure-hooks.js
let {defineSupportCode} = require('cucumber');
defineSupportCode(({After}) => {
After(function(scenario, done) {
let world = this;
if (scenario.isFailed()) {
world.takeAndSaveScreenshot().then(function(filename) {
console.log(`Screenshot saved at ${filename}`); //eslint-disable-line no-console
done();
View protractor-sharded.conf.js
const SHARD_COUNT = exports.SHARD_COUNT = +(process.env.PROTRACTOR_SHARD_COUNT || 4);
const _ = require('lodash');
const glob = require('glob');
const fs = require('fs');
exports.config = _.tap(_.clone(require('./protractor.conf.js').config), function (config) {
config.getMultiCapabilities = function () {
const shards = getShardedScenarios(getAllScenarios(config.capabilities.specs));
View gtm-test.sh
#!/usr/bin/env bash
echo -e "\n\n***\n*** Cleaning up\n***\n\n"
rm -rf ws1 ws2 remote
mkdir ws1 ws2 remote
echo -e "\n\n***\n*** initialize the remote repo\n***\n\n"
cd remote
git init --bare
cd ..
View keybase.md

Keybase proof

I hereby claim:

  • I am darrinholst on github.
  • I am darrinholst (https://keybase.io/darrinholst) on keybase.
  • I have a public key whose fingerprint is 713E D74E 3D82 55B8 1166 E5B8 8C50 64E5 B897 695D

To claim this, I am signing this object:

View drunk_tweets.rb
require 'csv'
require 'time'
drunk_tweets = []
CSV.new(File.new('tweets.csv'), headers: true, header_converters: :symbol).to_a.map(&:to_hash).each do |row|
tweet_hour = Time.parse(row[:timestamp]).hour
drunk_tweets << row if tweet_hour > 22 || tweet_hour < 5
end
View gist:11380513
#MaxHotkeysPerInterval 9000
WheelUp::
Send {WheelDown}
Return
WheelDown::
Send {WheelUp}
Return
@darrinholst
darrinholst / gist:5009667
Created Feb 22, 2013
unique twitter clients
View gist:5009667
require 'csv'
sources = {}
CSV.foreach("/Users/darrinholst/Downloads/tweets/tweets.csv") do |row|
source = row[6]
next if source == "source"
link = source.match(/>(.*)<\/a>/)
source = link[1] if link
count = sources[source] || 0
View pushit.coffee
# Description:
# Salt-n-Pepa
#
# Commands:
# push it - Display some motivation from Salt-n-Pepa
saltnpepas = [
"http://cdn.madamenoire.com/wp-content/uploads/2011/02/salt_n_pepa_1.jpg"
"http://upload.wikimedia.org/wikipedia/en/3/30/Push_It_by_Salt-N-Pepa_single_cover.jpg"
"http://blogs.laweekly.com/westcoastsound/Salt-N-Pepa49919.jpg"
View logging.rb
class ActiveRecord::LogSubscriber
def sql_with_filtering(event)
return if 'CACHE' == event.payload[:name]
sql_without_filtering(event)
end
alias_method_chain :sql, :filtering
end