Skip to content

Instantly share code, notes, and snippets.

@smerchek
smerchek / setup.sh
Created May 9, 2013 19:12
setting up a machine to build deb packages with fpm and fpm-cook
#setting up a machine to build deb packages
#http://lenni.info/blog/2012/05/installing-ruby-1-9-3-on-ubuntu-12-04-precise-pengolin/
sudo apt-get update
sudo apt-get install ruby1.9.1 ruby1.9.1-dev \
rubygems1.9.1 irb1.9.1 ri1.9.1 rdoc1.9.1 \
build-essential libopenssl-ruby1.9.1 libssl-dev zlib1g-dev
sudo update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.9.1 400 \
--slave /usr/share/man/man1/ruby.1.gz ruby.1.gz \

Using the JSON output of a Solr field analysis, to visualize the Lucene indexing/analysis pipeline.

@smerchek
smerchek / clean.sh
Created June 5, 2013 21:52
Remove all but most recent number of files in a directory
# Keep 4 most recent files/sub-directories
# source: http://superuser.com/a/260332
ls -r1 | tail -n +5 | xargs rm -rf
@smerchek
smerchek / windows_installer.pp
Last active October 17, 2016 13:29
Puppet for windows installers at Softek
# This is the basic structure for a Windows project puppet module at Softek
# We found that the Package type as provided by Puppet was not quite sufficient for our needs.
# Instead, we transfer the file, exec msiexec when it changes (while logging install output), and then ensure the service is running.
class some_project {
$installer = 'Project.Setup.msi'
$url = "puppet:///release/${installer}"
file { "c:/packages/${installer}":
ensure => 'file',
mode => '1777',
@smerchek
smerchek / food_permits.csv
Created November 21, 2013 19:36
KCMO Data
We can't make this file beautiful and searchable because it's too large.
Facility Permit #,Establishment Name,Facility Name,Facility Street No.,Facility Street Name,Facility Unit No,Facility City,Facility State,Facility Zip,Business Status,Facility Type,Permit Type,Web Site,Operational Status,Location 1
, Delaware Cafe, Delaware Cafe,300,Delaware,,Kansas City,MISSOURI,64105,Closed,Restaurant/Deli 0-5 Employees,,,Operational,"300 Delaware
Kansas City, MISSOURI 64105
(39.10926928022309, -94.58450117517305)"
,12TH & BALTIMORE,12TH & BALTIMORE,106 W 12TH ST,,Attn: Accounting Department,KANSAS City,MISSOURI,64105,Open,Restaurant/Deli 0-5 Employees,,,Operational,"106 W 12TH ST Attn: Accounting Department
KANSAS City, MISSOURI 64105
(39.103149999772825, -94.58638000023666)"
,135TH ST. B B Q,135TH ST. B B Q,325 E. 135TH ST,,,KANSAS CITY,MISSOURI,64145,Closed,Restaurant/Deli 0-5 Employees,,,Operational,"325 E. 135TH ST
KANSAS CITY, MISSOURI 64145
(38.882631716603704, -94.59216179033736)"
@smerchek
smerchek / learning_rails.md
Last active January 2, 2016 18:39
KCDC 2014 Session Proposal

Learning Rails for Fun and Nonprofit

There are a lot of nonprofits that need help building websites. While wordpress may suffice for many of these organizations, some have requirements that are better suited to an actual website. With free/cheap tools like Heroku and other database/logging services, quickly building a website that meets a nonprofit’s needs is very approachable. This is the perfect type project for learning Ruby on Rails.

In this session, Scott will talk about the benefits of using a Nonprofit web project to learn Rails and what he learned while building LoveKC.org. While this is not an in-depth introduction to Rails, expect to learn about various aspects of getting started with Rails like setting up user authentication and roles, geocoding, search with elasticsearch, mailings (Mailchimp and Mandrill), and image upload/manipulation. This is a good equipping session, showing you not only what is possible with Rails, but also how to start the journey yourself.

@smerchek
smerchek / codemash_2014.md
Created January 15, 2014 16:49
CodeMash 2014 Highlights/Notes

Putting the D&D in TDD (FULL DAY)

Guy Royse; George Walters

I used Ruby and Minitest with my Blink(1) to TDD through this very big Kata. It was fun and a great learning experience. It did a good job of going slowly at first to get the basics and then ramping up. There is much left that I could do here for further practice.

Sweet Elixir! A Gentle Introduction to Erlang’s cute younger brother Elixir (FULL DAY)

Ryan Cromwell; Chris McCord

@smerchek
smerchek / sum.js
Created January 15, 2014 22:55
Sum the items in an Amazon wish list (inspired by "Total up the cost of all items in an Amazon wishlist" https://gist.github.com/chrismbarr/3230548)
var list = $$("span.a-color-price.a-size-base");
var total=0;
for(i=0; i<list.length;i++){
total += parseFloat(list[i].innerText.replace("$",""));
}
alert(list.length+" items for a total of: $"+total.toFixed(2));
@smerchek
smerchek / blinky_formatter.rb
Created January 15, 2015 03:44
Blink(1) rspec formatter
require 'rspec'
require 'blinky'
# Usage: rspec --require blink_formatter.rb --format BlinkFormatter
# fix issue where no light will cause lock-up
module Blinky
class LightFactory
class << self
alias :original_detect_lights :detect_lights

Keybase proof

I hereby claim:

  • I am smerchek on github.
  • I am smerchek (https://keybase.io/smerchek) on keybase.
  • I have a public key whose fingerprint is E304 46D8 1409 1FEC 7106 8F61 64AB 9A52 9682 653B

To claim this, I am signing this object: