Skip to content

Instantly share code, notes, and snippets.

Being Inkcellent to Each Other

Ken Collins metaskills

Being Inkcellent to Each Other
View GitHub Profile
metaskills / gist:893599
Created Mar 29, 2011
A Copy Of sp_MSforeachtable Stored Procedure For Azure, Uses sp_MSforeach_worker
View gist:893599
CREATE proc [dbo].[sp_MSforeachtable]
@command1 nvarchar(2000), @replacechar nchar(1) = N'?', @command2 nvarchar(2000) = null,
@command3 nvarchar(2000) = null, @whereand nvarchar(2000) = null,
@precommand nvarchar(2000) = null, @postcommand nvarchar(2000) = null
declare @mscat nvarchar(12)
select @mscat = ltrim(str(convert(int, 0x0002)))
if (@precommand is not null)
View omniauth.rb
metadata = Rails.root.join 'config', 'myapp_ins-8d2c1e14da9ca2bc.xml'
idpdata =
parser =
SAML_SETTINGS = parser.parse_to_hash(idpdata)
Rails.application.config.middleware.use OmniAuth::Builder do
provider :saml, SAML_SETTINGS.merge(
issuer: 'myapp'
# Setup
aws application-autoscaling \
register-scalable-target \
--service-namespace "lambda" \
--resource-id "function:myapp:live" \
--min-capacity 5 \
--max-capacity 100 \
--scalable-dimension "lambda:function:ProvisionedConcurrency"
metaskills / wait_until.rb
Last active Oct 21, 2020
Never sleep() using Capybara!
View wait_until.rb
# WAIT! Do consider that `wait` may not be needed. This article describes
# that reasoning. Please read it and make informed decisions.
# Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations?
describe 'Modal' do
should 'display login errors' do
visit root_path
metaskills / gist:6414713
Created Sep 2, 2013
Jekyll tasks/post to help create a new post.
View gist:6414713
#!/usr/bin/env bash
if [ -z "$1" ]; then
echo "Usage: provide a title argument."
exit -1
d=$(date +"%Y-%m-%d")
metaskills / capysetup.rb
Created Sep 28, 2020
Rails Capybara System Tests Setup
View capysetup.rb
# Gemfile
gem 'selenium-webdriver'
# test/application_system_test_case.rb (or capy setup file)
require 'test_helper'
Capybara.server = :webrick
Webdrivers::Chromedriver.required_version = '2.36'
driver_path = Webdrivers::Chromedriver.update
metaskills /
Last active Aug 3, 2020
Ubuntu 16.04 Install Latest FreeTDS
$ sudo apt-get install wget
$ sudo apt-get install build-essential
$ sudo apt-get install libc6-dev
$ wget
$ tar -xzf freetds-1.00.27.tar.gz
$ cd freetds-1.00.27
$ ./configure --prefix=/usr/local --with-tdsver=7.3
$ make
$ make install
metaskills / layer_downloader.rb
Created Jul 25, 2020
Useful for Ruby/Docker SAM Projects
View layer_downloader.rb
require 'yaml'
require 'open-uri'
require 'aws-sdk-lambda'
class LayerDownloader
def download, 'wb') do |f| { |zip| f.write( }
metaskills / event.json
Created Jun 16, 2020
Sample API Gateway HTTP API Version 1 Event
View event.json
"version": "1.0",
"resource": "$default",
"path": "/",
"httpMethod": "GET",
"headers": {
"Content-Length": "0",
"Host": "",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Safari/605.1.15",
"X-Amzn-Trace-Id": "Root=1-5e7fe714-fee6909429159440eb352c40",
metaskills / aurora-stack.ts
Last active Jun 7, 2020
Aurora Serverless IaC Example Using CDK & TypeScript
View aurora-stack.ts
// Run `mkdir aurora && cd aurora && cdk init sample-app --language=typescript`
// and replace the `lib/aurora-stack.ts` with this file. May need to remove non-needed
// packages from package.json and add others like "@aws-cdk/aws-rds" and
// "@aws-cdk/aws-secretsmanager"
// Running assumes you pass in the following environment variables or hard code values.
You can’t perform that action at this time.