A userstyle that makes you wait ten seconds before entering a Hacker News thread. I use stylus to manage mine.
.subtext {
display: inline-block;
background: linear-gradient(to left, transparent 50%, #f60 50%) right;
text = ARGV.first || "y1u a5t p1l? j2t w4d to s1y hi" | |
times = (ARGV[1] || 1).to_i | |
words = File.readlines('/usr/share/dict/words') | |
.map(&:downcase) | |
.map(&:chomp) | |
times.times do | |
puts text.gsub(/\w+/) { |word| | |
words.select { |realword| |
A userstyle that makes you wait ten seconds before entering a Hacker News thread. I use stylus to manage mine.
.subtext {
display: inline-block;
background: linear-gradient(to left, transparent 50%, #f60 50%) right;
$<.to_a.tap {|e,rs|p rs.split(',').map(&:to_i).reject(&:zero?).map{|r|[r,r-(e.to_i%r)]}.min_by(&:last).inject(:*)} |
# dnsimple_ssl_to_linode_object_storage.rb | |
# Copy a certificate stored on DNSimple to Linode Object Storage | |
# | |
# Depends on 'http' gem | |
# | |
# Requires environment settings as such: | |
# LINODE_TOKEN=[API token] | |
# LINODE_REGION=[region of your object storage bucket] | |
# DNSIMPLE_TOKEN=[API token] | |
# DNSIMPLE_DOMAIN=example.com |
nums = $<.readlines.map(&:to_i) | |
w = 25 | |
w.upto(nums.length - 1) do |i| | |
p nums[i] if nums[i-w, w].combination(2) | |
.map(&:sum) | |
.all? { |x| x != nums[i] } | |
end | |
w.times do |cw| |
# Return GitHub API rate information in JSON format | |
# GitHub Personal Access Token expected in ~/.githubtoken | |
# I'd pipe this into jq for nicer viewing | |
require 'http' | |
require 'json' | |
TOKEN = File.read(ENV['HOME'] + "/.githubtoken").strip | |
res = HTTP["Authorization" => "token #{TOKEN}"].get("https://api.github.com/rate_limit") |
# gem 'pg' | |
# https://github.com/ged/ruby-pg | |
# http://deveiate.org/code/pg | |
# | |
# I always find it a nightmare to look up how it works because | |
# it's not intuitive at all. So here are some notes. | |
# CONNECTION | |
# ========== | |
# No connection URL support, so.. |
// a is the 'from name' | |
// b is the 'labels' | |
// you set these up in zapier after having gmail as a source | |
const slackURL = "https://hooks.slack.com/services/..."; | |
let mb = inputData.b; | |
let folder = "Unknown"; | |
if (mb.includes('CATEGORY_FORUMS')) { |
// See https://github.com/shelfio/chrome-aws-lambda-layer for more info | |
// on the layer needed to make chrome-aws-lambda work | |
const AWS = require('aws-sdk'); | |
const chromium = require('chrome-aws-lambda'); | |
exports.handler = async (event, context) => { | |
let sns = new AWS.SNS(); | |
let browser = await chromium.puppeteer.launch({ |
body { | |
font-family: "Menlo", Monaco, Consolas, monospace; | |
font-size: 16px; | |
line-height: 24px; | |
} | |
.container { | |
grid-template-columns: 2fr minmax(200px, 1fr) minmax(600px, 3fr) 3fr; | |
} |