- Install Chrome freak extension (https://chrome.google.com/webstore/detail/control-freak/jgnchehlaggacipokckdlbdemfeohdhc?hl=en)
- Visit Play store developer console and open an app listing
- Open control freak icon beside URL bar (look for the gears/setting icon on top-right of browser)
- In control freak, click on "This domain (play.google.com)
- In control freak, copy the CSS, JS, and Libs from above here
- Hit save and exit control freak
- Reload the page! App listing should now include %ge.
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
# WEB | |
# e.g. webcheck /about google.com google.co.uk | |
# will check each host in parallel, multiple times | |
function webcheck { | |
trap handle_sigint SIGINT | |
set +m | |
path=$1 | |
shift | |
hosts=$* | |
for host in $hosts ; do |
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
# Run this on console to check asset path will work | |
JsAssets::List.exclude = ['boot.js'] ; JsAssets::List.allow = %w(app.js models/*.js prod-*.css); `rm -fr tmp/cache`; JsAssets::List.fetch |
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
# adapted from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill | |
# with help from JS2Coffee | |
# https://codepen.io/mahemoff/pen/xOBgdk?editors=0010 | |
if typeof Object.assign != 'function' | |
Object.assign = (target) -> | |
index = 1 | |
while index < arguments.length |
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 Redis::Namespace | |
def delete_all_keys | |
keys = self.keys '*' | |
self.del keys if keys.present? | |
end | |
end | |
funky_redis = Redis::Namespace.new('funky', redis: Redis.new(url: '...')) | |
funky_redis.set 'count', 10 # makes funky:10 entry | |
funky_redis.delete_all_keys # deletes funky:10 entry |
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 String | |
# performance hack - memoize these regexps | |
SPACE_8_RE = Regexp.new('[[:space:]]'.encode('UTF-8')) | |
SPACE_16_RE = Regexp.new('[[:space:]]'.encode('UTF-16LE')) | |
def safe_strip | |
if self.encoding=='UTF-8' | |
self.gsub SPACE_8_RE, '' | |
elsif self.encoding=='UTF-16' |
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
/** | |
* Timeago is a jQuery plugin that makes it easy to support automatically | |
* updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago"). | |
* | |
* @name timeago | |
* @version 1.4.1 | |
* @requires jQuery v1.2.3+ | |
* @author Ryan McGeary | |
* @license MIT License - http://www.opensource.org/licenses/mit-license.php | |
* |
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
def short_time_ago(time, options={}) | |
timestamp = time.iso8601 | |
dist = DateTime.now.to_i - time.to_i | |
# Quick (non-i18n friendly hack to always show weeks instead of months (since "m" is ambiguous) | |
message = | |
if dist.to_i < 6.5.days || dist.to_i > 364.5.days | |
time_ago_in_words time, locale: :en_abbrev | |
else | |
"#{(dist/1.week).round}w" | |
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
#!/bin/bash | |
set -e | |
############################## | |
# CORE COMMANDS | |
############################## | |
function ap { ansible-playbook -i $inventory $* ; } | |
function flush_cache { ansible-playbook --flush-cache ; } |
Had to spend some hours fixing various tests. What could go wrong? Quite a few things I'll capture below:
- CircleCI login problem. To debug these, it would be useful to ssh to the build box, but it hasn't been possible for some weeks. Today I realised it's because the Github project owner is a different account, and since Github doesn't support the same ssh ID for different accounts, I made a custom ssh key, added it to Github, and could then ssh into the Circle box.
- There was a call using Mocha's
.any_instance.stubs
which was never restored. Some refactoring brought this bug to the open as tests maybe ran in a different order. There doesn't appear to be any way to globally reset all mocks, so I just added.any_instance.unstub
to undo this in the same test. - Another refactor inadvertently removed Sidekiq's "fake" framework, which is now in the superclass setup, so it will always be called.
Sidekiq::Worker.clear_all
andSidekiq::Testing.fake!
called every time. - Added error logging to a "Headles