Skip to content

Instantly share code, notes, and snippets.

@fizz
fizz / notificationsbot.coffee
Created December 12, 2017 00:06
VickyBot.coffee
# Update product notification emails
class NotificationsBot extends require('./vickybot').VickyBot
NotificationsBot::urls.products = ->
'/products/index.php'
NotificationsBot::selectors.pagination = '.limeListSelectBox'
NotificationsBot::selectors.loading = '#loadingproductList'
NotificationsBot::selectors.search_field = '#list_search_id_productList'
NotificationsBot::selectors.product =
@fizz
fizz / checkContacts.js
Created December 11, 2017 21:04
Clean up email address typos using kicksend/mailcheck + mailgun validator API
var prompt = require('prompt');
var mailgun = require('mailgun-validator')('YOUR_API_KEY');
var kicksend = require('mailcheck');
var mongo = require('mongoskin');
var db = mongo.db('localhost:27017/customers?autoreconnect');
var async = require('async');
var domains = [
@fizz
fizz / rails_postgres_enum.rb
Last active July 1, 2019 15:48 — forked from rtlnr/rails_postgres_enum.rb
Support for PostgreSQL enum types in Rails 5 (including schema dump)
module ActiveRecord
class SchemaDumper
def dump(stream)
header(stream)
extensions(stream)
enums(stream)
tables(stream)
trailer(stream)
stream
end
@fizz
fizz / keybase.md
Last active September 30, 2016 01:42
Keybase proof

Keybase proof

I hereby claim:

  • I am fizz on github.
  • I am fizz (https://keybase.io/fizz) on keybase.
  • I have a public key whose fingerprint is 3449 7523 241B CB60 E3AD 1279 85ED 974E D815 25E8

To claim this, I am signing this object:

@fizz
fizz / swap.pp
Last active September 30, 2016 01:41 — forked from philfreo/swap.pp
Manage swap on a node with puppet
# Manages swapspace on a node.
#
# Based on https://gist.github.com/Yggdrasil/3918632
#
# Parameters:
# - $ensure Allows creation or removal of swapspace and the corresponding file.
# - $swapfile Defaults to /mnt which is a fast ephemeral filesystem on EC2 instances.
# This keeps performance reasonable while avoiding I/O charges on EBS.
# - $swapsize Size of the swapfile in MB. Defaults to memory size.
#
@fizz
fizz / block.awk
Last active September 30, 2016 01:40
It's like grep for blocks (useful for git spelunking)
# Example: git show <treeish> | awk -f block.awk
# Selectively print sections matching regex in body of matches(), below
function matches(block) {
return (block ~ /\-\?\>/)
}
/diff/{
# start of a new block, process the previous
if (prevblock"" && matches(prevblock)) print prevblock