Skip to content

Instantly share code, notes, and snippets.

Ken Collins metaskills

Block or report user

Report or block metaskills

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
metaskills / ready.js
Created Jan 10, 2018
When Are Things Ready?
View ready.js
document.addEventListener('DOMContentLoaded', function(){
document.addEventListener('turbolinks:load', function(){
console.log('jQuery Document Ready');
metaskills / foo.rb
Created Jan 10, 2018
Basic HTML Page
View foo.rb
<!DOCTYPE html>
<title>My Page</title>
<script src="..."></script>
<h1>Hello World!</h1>
<script src="..."></script>
metaskills / sam-validate.rb
Created Dec 28, 2017
Parse AWS SAM YAML Templates & Validate JSON Schema
View sam-validate.rb
#!/usr/bin/env ruby
require 'pp'
require 'json'
require 'yaml'
require 'open-uri'
require 'json-schema'
SCHEMA = begin
file = open('')
metaskills /
Last active Aug 29, 2017
Shell Function for
gitio () {
local url=$(curl -s -i -F "url=$1" | grep "Location: " | cut -d" " -f2)
echo -n $url | tr -d '\n' | pbcopy
echo $url
metaskills / bm.rb
Created Aug 1, 2017
Simple SQL Server & PG Rails Benchmarks.
View bm.rb
#!/usr/bin/env ruby
require 'benchmark'
require 'bundler/inline'
gemfile true do
source ''
gem 'activerecord-sqlserver-adapter', ENV['VER_AR'] || '~> 5.1.0'
gem 'tiny_tds', ENV['VER_TTDS'] || '~> 2.0.0'
gem 'pg'
metaskills / lp.js
Last active Jan 17, 2018
LivePerson/Engage Turbolinks Hacking
View lp.js
// Assuming you put the LP init code into a function called window.lpTagCustomInit
document.addEventListener('turbolinks:before-cache', function(){
document.addEventListener('turbolinks:load', function(){
delete window.liveperson;
delete window.lpMTagConfig;
delete window.lpTag;
metaskills / vcr_helper.rb
Created Jun 19, 2017
Per-Service VCR Cassettes - Reuse Common API Requests Across Your App's Tests
View vcr_helper.rb
# This assumes you have a client with a URL config. Hard coded URLs work too.
# Will automiatically insert cassets whenever needed and organize them per servcie.
VCR.configure do |c|
c.around_http_request do |request|
if request.uri =~
VCR.use_cassette 'my_service', default_cassette_options, &request
metaskills / prepend.rb
Created May 11, 2017
Using Module Prepend To Extend Ruby Classes
View prepend.rb
class Foo
attr_reader :bar
def initialize
@bar = 'bar'
module Bar
def bar
# Always make it easy to edit all the script.
$ which profile
profile: aliased to subl ~/.zshkit ~/.zshkit/01_path
# Always make it easy to version control my ZSH kit.
# Ex: `profile-save "New Docker Functions"`
$ which profile-save
profile-save () {
pushd ~/.zshkit/
git add .
View 240.rb
>> RbConfig::CONFIG.each { |k,v| puts "#{k} => #{v}\n" } ; true
MAJOR => 2
MINOR => 4
TEENY => 0
INSTALL => /opt/local/bin/ginstall -c
prefix => /Users/kencollins/.rbenv/versions/2.4.0
ruby_install_name => ruby
You can’t perform that action at this time.