Skip to content

Instantly share code, notes, and snippets.

Ken Collins metaskills

View GitHub Profile
@metaskills
metaskills / gist:5024393
Created Feb 24, 2013
Bootstrap 2.3's mixin.less incompatibilities.
View gist:5024393
@@ -558,13 +567,13 @@
.core (@gridColumnWidth, @gridGutterWidth) {
.spanX (@index) when (@index > 0) {
- (~".span@{index}") { .span(@index); }
+ .span@{index} { .span(@index); }
.spanX(@index - 1);
}
.spanX (0) {}
@metaskills
metaskills / wait_until.rb
Created Aug 26, 2011
Never sleep() using Capybara!
View wait_until.rb
# 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
click_link 'My HomeMarks'
within '#login_area' do
fill_in 'email', with: 'will@not.work'
fill_in 'password', with: 'test'
@metaskills
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
AS
declare @mscat nvarchar(12)
select @mscat = ltrim(str(convert(int, 0x0002)))
if (@precommand is not null)
exec(@precommand)
@metaskills
metaskills / demo.rb
Last active Nov 28, 2018
Using IMGIX to Personalize Knolled Images
View demo.rb
require 'open-uri'
require 'bundler/inline'
gemfile true do
source 'https://rubygems.org'
gem 'imgix'
gem 'launchy'
end
DESIGN_URL = 'https://www.customink.com/email/imgix/design.png'
@metaskills
metaskills / command.sh
Last active Nov 12, 2018
Ubuntu 16.04 Install Latest FreeTDS
View command.sh
$ sudo apt-get install wget
$ sudo apt-get install build-essential
$ sudo apt-get install libc6-dev
$ wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.00.27.tar.gz
$ 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
metaskills / gist:3170386
Created Jul 24, 2012
Mapping A Sass List To A Comma Separated Selector
View gist:3170386
// Using this code below, I was able to itterate over a list of
// color names and append them to an empty list. I was then able
// to use the selectors from there.
$selectors: ();
@each $value in $my-colors-names {
$selector: unquote(".box.#{$value} .box-header");
$selectors: append($selectors, $selector, comma);
}
#{$selectors} { @extend .color-white; }
View Gemfile
gem 'jekyll', '~> 2.0.0.alpha'
gem 'nokogiri'
gem 'redcarpet'
gem 'rouge'
@metaskills
metaskills / passenger.rb
Created Sep 18, 2015
Rails Multi-Database Best Practices Roundup - config/initializers/passenger.rb - http://technology.customink.com/blog/2015/06/22/rails-multi-database-best-practices-roundup/
View passenger.rb
if defined?(PhusionPassenger)
PhusionPassenger.on_event(:starting_worker_process) do |forked|
if forked
ActiveRecord::Base.clear_all_connections!
MysqlBase.establish_connection MysqlBase.configurations['mysql'][Rails.env]
end
end
end
@metaskills
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(){
jQuery("[id^='LP_DIV']").empty();
})
document.addEventListener('turbolinks:load', function(){
delete window.liveperson;
delete window.lpMTagConfig;
delete window.lpTag;
@metaskills
metaskills / reconstructor.coffee
Created Jan 10, 2018
Turbolinks & jQuery ReConstructor Pattern
View reconstructor.coffee
class Toolbar
constructor: ->
document.addEventListener 'turbolinks:before-cache', @turboBeforeCache
@reConstructor()
reConstructor: ->
@registerWaypoint()
registerWaypoint: ->
You can’t perform that action at this time.