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 / 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 / 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 /
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 / transaction_fixtures.rb
Created Oct 20, 2015
Rails 4.2 Capybara Transactional Fixtures Example.
View transaction_fixtures.rb
class ActiveRecord::Base
def self.connection ; CONNECTION_LOCK.synchronize { @@shared_base_connection ||= retrieve_connection } ; end
metaskills / output.txt
Created Feb 22, 2017
Test FreeTDS Connection
View output.txt
$ tsql -S localhost -U sa -P $SA_PASSWORD
locale is "en_US.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
2> GO
Microsoft SQL Server vNext (CTP1.3) - 14.0.304.138 (X64)
Feb 13 2017 16:49:12
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
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
View demo.scss
$my-color-names: ( 'inchworm', 'sunglow', 'scarlet');
$my-colors: ( #a5de37, #ffd426, #ff4351 );
@each $name in $my-color-names {
$index: index($my-color-names, $name);
$color: nth($my-colors, $index);
%my-#{$name}-background-color { background-color: $color; }
%my-#{$name}-border-color { border-color: $color; }
You can’t perform that action at this time.