Skip to content

Instantly share code, notes, and snippets.

Douglas F Shearer dougal

Block or report user

Report or block dougal

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View distrify-fluidvids-demo.html
<!DOCTYPE html>
<html>
<head>
<title>Distrify Fluidvids Demo</title>
</head>
<body>
<iframe src="https://embeds.distrify.com/player/9HzvRg" width="640" height="360" frameborder="0" scrolling="no" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<script type="text/javascript" src="https://raw.githubusercontent.com/toddmotto/fluidvids/master/dist/fluidvids.min.js"></script>
View fallout3_terminal_hacker.rb
#known = {'ponderous' => 2, 'poisoning' => 3} # companies
#known = {'setting' => 1} # devolve
#known = {'capacity' => 3} # creating
#known = {'merciless' => 1, 'completes' => 2, 'monitored' => 1 }
#known = {'rearguard' => 1, 'fortified' => 3, 'concerned' => 5} # conducted (guess of two)
#known = {'depending' => 3, 'decisions' => 2} # reprimand
known = {} # origins
def matches(word, other_word, number)
word = word.split(//)
@dougal
dougal / cpuinfo.txt
Last active Nov 15, 2016
Packet.net Type 2a - Dual Cavium ThunderX ARMv8
View cpuinfo.txt
root@eric:~# cat /proc/cpuinfo
processor : 0
BogoMIPS : 200.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics
CPU implementer : 0x43
CPU architecture: 8
CPU variant : 0x1
CPU part : 0x0a1
CPU revision : 1
@dougal
dougal / info.txt
Last active Oct 26, 2016
Elixir Registry Benchmarks, 2016-10-26, Revision b1d70af
View info.txt
dougal@xeoncopter:~/registry$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
dougal@xeoncopter:~/registry$ uname -a
Linux xeoncopter 4.4.0-42-generic #62-Ubuntu SMP Fri Oct 7 23:11:45 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
@dougal
dougal / date_parse_bm.rb
Created Oct 13, 2016
Custom date parser vs. Date.parse for Hyphenated ISO 8601 dates
View date_parse_bm.rb
require 'date'
require 'benchmark/ips'
def custom_date_parse(str)
Date.new(str[0,4].to_i, str[5,2].to_i, str[8,2].to_i)
end
Benchmark.ips do |x|
x.time = 5
x.warmup = 2
View order_creator.rb
class OrderCreator
def initialize(order_klass=Order, tax_calculator_klass=TaxCalculator)
end
def create(order_params)
order = order_klass.new(order_params)
tax_service = tax_calculator_klass.new
order = tax_service.calculate(order)
View dtrace-3.4.0.txt
This file has been truncated, but you can view the full file.
dtrace: 17114 dynamic variable drops with non-empty dirty list
55855/0x139370c: thread_selfid(0x7FB67BD01620, 0x7FB67BD015F0, 0x7FB67BD003A0) = 20526860 0
55855/0x139370c: csops(0x0, 0x0, 0x7FFF5A772670) = 0 0
55855/0x139370c: issetugid(0x0, 0x0, 0x7FFF5A772670) = 0 0
55855/0x139370c: shared_region_check_np(0x7FFF5A770568, 0x0, 0x7FFF5A772670) = 0 0
55855/0x139370c: stat64("/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation\0", 0x7FFF5A7718E8, 0x7FFF5A772670) = 0 0
55855/0x139370c: stat64("/usr/lib/libSystem.B.dylib\0", 0x7FFF5A7718E8, 0x7FFF5A772670) = 0 0
55855/0x139370c: stat64("/usr/local/opt/gmp/lib/libgmp.10.dylib\0", 0x7FFF5A7718E8, 0x7FFF5A772670) = 0 0
55855/0x139370c: open("/usr/local/opt/gmp/lib/libgmp.10.dylib\0", 0x0, 0x0) = 3 0
View custom_counter_cache_bug_rails4
unless File.exists?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
gem 'sqlite3'
GEMFILE
system 'bundle'
end
@dougal
dougal / gist:4634679
Created Jan 25, 2013
Reduce size of vagrant boxes before packaging.
View gist:4634679
apt-get clean
rm -r "$(gem env gemdir)"/doc/*
dd if=/dev/zero of=/EMPTY bs=1M
rm -f /EMPTY
View gist:3193065
Type of complaint:
BBC Online
What is your complaint about:
BBC Sport Online
URL:
http://www.bbc.co.uk/sport/olympics/2012/live-video/p00w2rlr
Complaint category:
You can’t perform that action at this time.