I hereby claim:
- I am eddanger on github.
- I am mdub (https://keybase.io/mdub) on keybase.
- I have a public key whose fingerprint is 9B97 8FB4 E1AE 5F68 597B 5CA4 C4E7 481F 2711 9334
To claim this, I am signing this object:
module Rack | |
class Censor | |
WORDS = [ 'shit', 'fuck', 'cock', 'cunt', 'cameltoe', 'mooseknuckle' ].map { |w| Regexp.new(w, Regexp::IGNORECASE) }.freeze | |
attr_reader :options, :request | |
def initialize(app, options={}) | |
@app, @options = app, { | |
:replacement => '*****' |
#!/usr/bin/env ruby | |
logfiles = Dir["#{ENV['HOME']}/**/app/../log/*.log"] # any file with a .log extension in a log directory besides an app directory... | |
logfiles.each {|file| system "echo '' > #{file}"} | |
puts "Cleaned #{logfiles.size} logs..." |
require 'rubygems' | |
require 'active_resource' | |
require 'basecamp' | |
require 'httparty' | |
require 'json' | |
GITHUB_USERNAME = '__GITHUB_USERNAME__' | |
GITHUB_PASSWORD = '__GITHUB_PASSWORD__' | |
GITHUB_ORG = '__GITHUB_ORG__' | |
GITHUB_REPO = '__GITHUB_REPO__' |
locale = YAML.load_file("#{Rails.root}/config/locales/en.yml") | |
new_locale = zero_value_in_hash(locale) | |
puts new_locale.to_yaml |
start1 = Time.parse('01:00') | |
end1 = Time.parse('10:00') | |
timespan1 = (start1.to_i..(end1.to_i - 1)) | |
timespan1b = (start1.to_i..(end1.to_i - 1)).step(1.minute) | |
start2 = Time.parse('10:00') | |
end2 = Time.parse('18:30') | |
timespan2 = (start2.to_i..(end2.to_i - 1)) | |
timespan2b = (start2.to_i..(end2.to_i - 1)).step(1.minute) |
# Docs: http://smartinez87.github.io/exception_notification/ | |
module ExceptionNotifier | |
class SlackNotifier | |
def initialize(options) | |
# do something with the options... | |
@channel = options[:channel] || '#somechannel' | |
@team = options[:team] || 'someteam' | |
@token = options[:token] || '__top_secret_token__' | |
@username = options[:username] || 'somename' |
I hereby claim:
To claim this, I am signing this object:
This super lightweight Rails API project will contain the following bits of awesomeness to get you started on your new app.
Add com.coverall
file to /etc/pf.anchors
with:
rdr pass on lo0 inet proto tcp from any to 127.0.0.1 port = 80 -> 127.0.0.1 port 8080
rdr pass on en0 inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
rdr pass on en1 inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
rdr pass on en2 inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
Update pf.conf
to point to this new file a-la:
# http://sakurity.com/blog/2015/06/04/mongo_ruby_regexp.html | |
# There’s a subtle bug in BSON-ruby implementation, leading in best case | |
# scenario to low-severity DoS, but most likely to critical BSON Injection | |
# (similar to SQL injection) - depends on gem versions you use. | |
# b = Moped::BSON::ObjectId | |
# puts "Injection!" if b.legal? "a"*24+"\na" | |
# puts "DOS" if b.legal? "a"*24+"\n" |