Skip to content

Instantly share code, notes, and snippets.

@qrohlf
qrohlf / tri-test.js
Created October 13, 2017 18:04
tri-test
adf
// Make fetch evil - useful for testing retry logic
// MAKE FETCH EVIL - THIS SHOULD NOT BE IN THE FINAL COMMIT
const _fetch = window.fetch
const evilFetch = function () {
const r = Math.random()
if (r < 0.5) {
return _fetch.apply(null, arguments)
} else if (r < 0.75) {
console.warn('mocking fetch with TypeError')
@qrohlf
qrohlf / .gitignore
Created June 16, 2015 14:31
Trianglify Wallpaper set
We couldn’t find that file to show.
@qrohlf
qrohlf / App.jsx
Last active August 29, 2015 14:16
Slow React Example
class GlyphiconGrid extends React.Component {
constructor(props) {
super(props);
this.state = {filter: ''};
this.glyphicons = ["asterisk", "plus", "euro", "eur", "minus", "cloud", "envelope", "pencil", "glass",
"music", "search", "heart", "star", "star-empty", "user", "film", "th-large", "th", "th-list", "ok",
"remove", "zoom-in", "zoom-out", "off", "signal", "cog", "trash", "home", "file", "time", "road",
"download-alt", "download", "upload", "inbox", "play-circle", "repeat", "refresh", "list-alt", "lock",
"flag", "headphones", "volume-off", "volume-down", "volume-up", "qrcode", "barcode", "tag", "tags",
"book", "bookmark", "print", "camera", "font", "bold", "italic", "text-height", "text-width",
@qrohlf
qrohlf / Gemfile
Last active August 29, 2015 14:10
ruby imgur api example with Sinatra
ruby "2.1.4"
source 'https://rubygems.org'
gem 'sinatra', '>= 1.4.5'
gem 'imgur-api', require: 'imgur'
gem 'tux'
group :development do
gem 'sqlite3', '>= 1.3.9'
gem 'shotgun', '>= 0.9'
end
@qrohlf
qrohlf / test.rb
Last active August 29, 2015 14:08
odd rails template error
after_bundle do
puts "it worked"
end
#as seen at http://edgeguides.rubyonrails.org/rails_application_templates.html#after-bundle-block
@qrohlf
qrohlf / wow.sh
Created October 5, 2014 23:14
O.o
$ cd ~/Code/sensible-web-development/_chapters
$ find . -type f | xargs wc -w | tail -1l
10901 total
# O.o
@qrohlf
qrohlf / partytime.md
Last active August 29, 2015 14:05
Instant OSX Terminal Party

Normal Background

. <(curl -s https://raw.githubusercontent.com/qrohlf/dotfiles/master/functions/party.sh) && party

Dark Background

osascript -e "tell application \"Terminal\" to set background color of window 1 to {5000, 5000, 5000}"