This file contains 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
defp store_jitter received_at, delivered_at do | |
received_usec = Time.to_usecs received_at | |
delivered_usec = Time.to_usecs delivered_at | |
jitter_usecs = delivered_usec - received_usec | |
delivered_sec = delivered_at |> Time.to_secs |> trunc | |
delivered_5m = delivered_at |> Time.to_secs |> trunc |> rem 300 | |
delivered_1h = delivered_at |> Time.to_secs |> trunc |> rem 3600 | |
{:ok, _} = R.query [ | |
["MULTI"], | |
["ZADD", namespace("jitter"), delivered_usec, jitter_usecs], |
This file contains 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 | |
# I use this to install Elixir on our codeship instances for testing. YMMV. | |
# curl -O https://gist.githubusercontent.com/jamesotron/44f8962cddef781ab830/raw/e75599e95587cbca26e707505fd40dd0f26eb0f5/install_ex.sh | |
# . ~/install_ex.sh | |
# You can override your Elixir and Erlang versions from your shell when you call ./install_ex.sh. | |
export ERLANG_VERSION=${ERLANG_VERSION:-18.0.3} | |
export ELIXIR_VERSION=${ELIXIR_VERSION:-1.0.5} |
This file contains 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
module Enumerable | |
# Duck punch for Enumerable that adds skip() to bypass | |
# the first `n` elements of the enumerator. | |
# Use skip/take to retrieve a range of values from an enumerable | |
# without forcing the values into an array and using []. | |
# | |
# This is substantially faster for really big collections, but | |
# not so much for small ones. ie use at your own risk | |
# Also, skip provides superficially the same behaviour as drop, |
This file contains 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
# Never forward addresses in the non-routed address spaces. | |
bogus-priv | |
# Filter useless windows-originated DNS requests. | |
filterwin2k | |
# Drop privileges from root to this user and group. | |
user=dnsmasq | |
group=nogroup | |
# By default, dnsmasq binds the wildcard address, even when only listening on |
This file contains 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
--- user.rb.orig 2015-01-10 20:53:40.369172619 +0000 | |
+++ user.rb 2015-01-10 19:16:38.650782073 +0000 | |
@@ -180,6 +180,8 @@ | |
scope :without_projects, -> { where('id NOT IN (SELECT DISTINCT(user_id) FROM members)') } | |
scope :potential_team_members, ->(team) { team.members.any? ? active.not_in_team(team) : active } | |
+ after_create :confirm! | |
+ | |
# | |
# Class methods |
This file contains 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
Fetching: https://rubygems.org/specs.4.8.gz | |
Total gems: 505858 | |
Fetching 94 gems | |
....404 on application_seeds-0.1.0.gem | |
......404 on dwradcliffe_test_gem_push-0.0.4.gem | |
....404 on good-0.1.2.gem | |
.........404 on filelock-1.0.2.gem | |
..................404 on picasawebalbums-1.4.6.gem | |
.....................................................Deleting 0 gems |
This file contains 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
module AssetsHelper | |
def inline_asset name | |
Rails.application.assets.find_asset(name).source | |
end | |
end |
This file contains 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
[08:27][jnh@Bucket]~$ brew upgrade -v gdk-pixbuf | |
==> Upgrading 1 outdated package, with result: | |
gdk-pixbuf 2.30.8 | |
==> Upgrading gdk-pixbuf | |
rm /usr/local/bin/gdk-pixbuf-csource | |
rm /usr/local/bin/gdk-pixbuf-pixdata | |
rm /usr/local/bin/gdk-pixbuf-query-loaders | |
rm /usr/local/include/gdk-pixbuf-2.0 | |
rm /usr/local/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-ani.la | |
rm /usr/local/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-ani.so |
This file contains 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
class KStruct | |
def self.new *attr_names | |
Class.new(Struct) do | |
attr_accessor *attr_names | |
end | |
end | |
class Struct | |
def initialize args |
This file contains 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
!RBIX | |
3820501463222725467 | |
0 | |
M | |
1 | |
n | |
n | |
n | |
i | |
19 |