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
# Code adapted from: https://shivama205.medium.com/audio-signals-comparison-23e431ed2207 | |
import argparse | |
import subprocess | |
import numpy | |
# seconds to sample audio file for | |
sample_time = 500 | |
# number of points to scan cross correlation over | |
span = 150 |
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
[Bb F g d g d Eb F] x3 | |
Bb Eb F d | |
the sharpest girl at the party house | |
g Eb Bb F | |
you laughed at all the right times | |
Bb Eb F d | |
your eyes are like a ferrari, girl, | |
g Eb Bb F | |
you've got eyes with brains behind |
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/bin/env ruby | |
# Uncomment & fix the following line to test against a local checkout of connection_pool | |
# $LOAD_PATH.unshift '/Users/gabriel/oss/connection_pool/lib' | |
require 'redis' | |
require 'connection_pool' | |
require 'timeout' | |
pool = ConnectionPool.new(size: 5, timeout: 5) do |
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 ( | |
"bufio" | |
"fmt" | |
"io" | |
"os" | |
"os/exec" | |
) |
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
→ ./tester.rb | |
initialized with . | |
Compile called | |
→ ./tester.rb --dir . | |
initialized with . | |
Compile called | |
→ ./tester.rb deploy | |
initialized with . | |
Deploy called | |
→ ./tester.rb deploy --dir . |
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/bin/env bash | |
# Dropbox apparently has a potential bug where files can be zeroed out. | |
# Description here: | |
# http://konklone.com/post/dropbox-bug-can-permanently-lose-your-files | |
# | |
# The script in that article to detect zero-byte files is pretty naive about | |
# files that normally would be zero bytes, so here's an improved version that | |
# ignores some common cases: | |
# - Mac OS icons |
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
var assert = require('assert'); | |
var LinkedStack = (function(){ | |
function Item(data){ | |
this.data = data; | |
this.next = null; | |
} | |
Item.prototype = { | |
tail: function(){ |
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 'minitest/autorun' | |
class LinkedStack | |
class ElementNotFound < RuntimeError; end | |
attr_reader :head | |
def empty? | |
@head == nil | |
end |
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 File.expand_path(File.dirname(__FILE__) + '/edgecase') | |
# Greed is a dice game where you roll up to five dice to accumulate | |
# points. The following "score" function will be used to calculate the | |
# score of a single roll of the dice. | |
# | |
# A greed roll is scored as follows: | |
# | |
# * A set of three ones is 1000 points | |
# |
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
messages = [nil, "Fizz", "Buzz", "FizzBuzz"] | |
acc = 810092048 | |
(1..100).each do |i| | |
c = acc & 3 | |
puts messages[c] || i | |
acc = acc >> 2 | c << 28 | |
end | |
# Explanation | |
# |
NewerOlder