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
const regenerate = require('regenerate'); | |
/* char-graphic? */ | |
const SETS = ['Letter', 'Mark', 'Number', 'Punctuation', 'Symbol'].map(category => | |
require(`unicode-10.0.0/General_Category/${category}/code-points.js`)); | |
/* char-blank? */ | |
// const SETS = [['\t']].concat(['Space_Separator'].map(category => | |
// require(`unicode-10.0.0/General_Category/${category}/code-points.js`))); |
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
# -*- encoding : utf-8 -*- | |
#= Rainbows HTTP server (on unix socket!) | |
#== Rainbows can be used to manage multiple forked workers in a specified concurrency-IO model | |
# Set working directory for Capistrano | |
# pwd -L keeps symlinks | |
working_directory `pwd -L`.chomp | |
# Listen through a unix socket |
This is a userscript with a light-on-dark content-centered style for plain/text documents.
To install this userscript in Chrome, save the JavaScript file and drag it onto the chrome://extensions page.
If you use ViolentMonkey, TamperMonkey, or GreaseMonkey, install from one of these links:
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
require 'resque_mailer' | |
require 'devise/async' | |
# pop and set locale from the args before running | |
module PerformWithLocale | |
def perform(*args) | |
I18n.with_locale(args.pop) do | |
super(*args) | |
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
# Place this file into lib/dependencies_logger.rb and require it from application.rb after Bundler.require as: | |
# require_relative '../lib/dependencies_logger' | |
require 'active_support/dependencies' | |
class DependenciesLogger | |
def initialize | |
@need_newline = false | |
@load_depth = 0 | |
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
require 'openssl' | |
require 'net/http' | |
require 'net/https' | |
module CloudFront | |
extend self | |
def invalidate(path) | |
date = Time.now.utc | |
date = date.strftime("%a, %d %b %Y %H:%M:%S %Z") |
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 tracking what they have and have not already read | |
D, [2016-08-12T09:16:45.975024 #5152] DEBUG -- : [1m[35m (0.1ms)[0m BEGIN | |
D, [2016-08-12T09:16:45.975303 #5152] DEBUG -- : [1m[36m (0.2ms)[0m [1mCOMMIT[0m | |
D, [2016-08-12T09:16:45.975575 #5152] DEBUG -- : [1m[35m (0.1ms)[0m BEGIN | |
D, [2016-08-12T09:16:45.977178 #5152] DEBUG -- : [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m | |
D, [2016-08-12T09:16:45.978641 #5152] DEBUG -- : [1m[35mSQL (0.3ms)[0m INSERT INTO "users" ("email", "name", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["email", "user220@example.com"], ["name", "Dr. Ellis O'Keefe"], ["created_at", "2016-08-12 09:16:45.977492"], ["updated_at", "2016-08-12 09:16:45.977492"]] | |
D, [2016-08-12T09:16:45.979315 #5152] DEBUG -- : [1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m | |
D, [2016-08-12T09:16:45.980593 #5152] DEBUG -- : [1m[35m (0.1ms)[0m SAVEPOINT active_record_1 | |
D, [2016-08-12T09:16:45.982087 #5152] DEBUG -- : [1 |
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
require 'i18n/tasks/base_task' | |
... | |
def i18n_status | |
task = I18n::Tasks::BaseTask.new | |
@missing = task.missing_keys | |
@unused = task.unused_keys | |
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
#!/usr/bin/env ruby | |
def convert(lang, md) | |
md.gsub(/\t/, ' ' * 4).gsub(/((?:^\s{4}[^\n]*\n)+)/) { | |
"\n```#{lang}#{$1.gsub(/^[ ]{4}/, '')}```\n" | |
} | |
end | |
argv = ARGV.dup | |
path = argv.pop or raise 'pass path' |