Skip to content

Instantly share code, notes, and snippets.

View kennethkalmer's full-sized avatar

Kenneth Kalmer kennethkalmer

View GitHub Profile
@kennethkalmer
kennethkalmer / irb
Created June 5, 2014 08:24
Module magic with extend self, and extending others
irb(main):001:0> Bar.bar
=> :barred
irb(main):002:0> Bar.new.bar
=> :barred
irb(main):003:0> Foo.bar
=> :barred
@kennethkalmer
kennethkalmer / README.md
Last active August 29, 2015 14:02
School Online Bootstrap Guide/Kit

Kudos to @paulscott56 for the cool name. It all started on twitter.

School Online Bootstrap Guide/Kit

School websites suck, actually, schools suck at being online. But in reality, schools don't need much to be online. 99/100 times the minimum viable school site might just be single static page with contact information, links to FB and/or Twitter. Oh, and a "add my to the mailing list" feature, cause that would be better...

The sad thing is that currently we have three camps, maybe more:

  1. Schools getting exploited by unsavoury IT companies and paying big bucks for mediocre FOSS deployments with Corel Draw graphics.
  2. Schools teachers acting defensively against anyone who is better than them at operating Dreamweaver
@kennethkalmer
kennethkalmer / _README.md
Last active August 29, 2015 14:02
Apply a PowerDNS on Rails macro to a bunch of domains on the command line

Bulk macros

Throw this script in the tmp directory of where your PowerDNS on Rails installation lives, make is executable and run like this:

$ ./tmp/apply-macro.rb 1 example.com example.org example.net

It will load the macro with ID 1, and apply it against each domain passed as CLI arguments.

Keybase proof

I hereby claim:

  • I am kennethkalmer on github.
  • I am kennethkalmer (https://keybase.io/kennethkalmer) on keybase.
  • I have a public key whose fingerprint is 9970 D42A 6E04 2612 1DD0 BF99 7EC6 DBDB 18C5 AFDD

To claim this, I am signing this object:

diff --git a/audited-activerecord.gemspec b/audited-activerecord.gemspec
index 089c94a..2a1e86e 100644
--- a/audited-activerecord.gemspec
+++ b/audited-activerecord.gemspec
@@ -20,6 +20,7 @@ Gem::Specification.new do |gem|
gem.files = `git ls-files lib`.split($\).grep(/(active_?record|generators)/)
gem.files << 'LICENSE'
+ gem.test_files = `git ls-files -- {test,spec}/*`.split($\).reject { |f| f =~ /mongo_mapper/ }
gem.require_paths = ['lib']
@kennethkalmer
kennethkalmer / _README.md
Last active August 29, 2015 14:16
Temporary node proxy while ember toolchain fixes the bugs with theirs

Simple proxy

$ git clone https://gist.github.com/kennethkalmer/de832976dedc4ab64798.git proxy
$ cd proxy
$ npm install
$ node proxy.js

profit

alias webshare='python -c "import SimpleHTTPServer;SimpleHTTPServer.test()"'
<style type="text/css">
#left {
float: left;
width: 200px;
}
#right {
margin-left: 200px;
}
</style>
<div>
#!/bin/bash
#
# Find all the rails projects from this directory down and clear their log
# files to save some space.
#
base=`pwd`
for path in `find $base -type f -path '*/config/environment.rb'`
do