Skip to content

Instantly share code, notes, and snippets.

View jstoks's full-sized avatar

Justin Scott jstoks

View GitHub Profile
# Keyboards for a Better You
---
##### Keyboard Layouts
##### Mechanical Keyboards
##### Ergonomics
---

Keybase proof

I hereby claim:

  • I am jstoks on github.
  • I am jstoks (https://keybase.io/jstoks) on keybase.
  • I have a public key ASDLN5C53OXN0Neug7Z-6HsGXM6he6LF1SbH0ICCMLLHrwo

To claim this, I am signing this object:

#!/usr/bin/env ruby
# For when you just can't decide what to eat for lunch
if ARGV.first == '-h'
puts "Whatchu want for lunch?"
end
contents= %w{corn meat beef ham bacon chicken pork cheese potato tofu pickle}
forms = %w{dogs balls legs burgers nachos salad potpie sandwich noodles rice omlette}
(ARGV.first || 1).to_i.times do
@jstoks
jstoks / README-Template.md
Created August 30, 2018 16:08 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@jstoks
jstoks / operation.rb
Created August 18, 2018 22:01
Operation object
require "wisper"
# Encapsulates a high level operation or business usecase
class Operation
include Wisper::Publisher
class Error < RuntimeError; end
class HaltOperation < RuntimeError; end
# Registeres a code as a possible response
@jstoks
jstoks / base.skin
Created January 30, 2018 22:25 — forked from Sythelux/base.skin
basic skin template for plantuml skins
skinparam Activity {
ArrowColor
ArrowFontColor
ArrowFontName
ArrowFontSize
ArrowFontStyle
BackgroundColor
BarColor
BorderColor
BorderThickness
@jstoks
jstoks / duck_call.rb
Last active August 4, 2017 21:34
Make a callable satisfy an interface
def DuckCall(method_name, callable = nil, &block)
callable = block unless callable
callable.define_singleton_method(method_name) do |*args|
call(*args)
end
callable
end
@jstoks
jstoks / S.sh
Last active March 28, 2018 14:17
#!/bin/bash
if [ -z "$1" ]; then
echo "Must provide at least one dank argument."
echo "Usage: `basename \"$0\"` outline inner outer"
exit 1
fi
read -r -d '' S << TheS
++++000++++
@jstoks
jstoks / latin1_to_utf8.rb
Last active March 17, 2017 21:32
Dealing with utf8 characters in latin1 mysql tables.
#!/usr/bin/env ruby
#mysqldump --add-drop-table source_db | replace CHARSET=latin1 CHARSET=utf8 | replace "CHARACTER SET latin1" "CHARACTER SET utf8" | replace '),(' $'),\n(' | latin1_to_utf8.rb | mysql --default-character-set=utf8 dest_db
def latin1_to_utf8(str)
str.dup.encode('cp1252',fallback: {
"\u0081" => "\x81".force_encoding("cp1252"),
"\u008D" => "\x8D".force_encoding("cp1252"),
"\u008F" => "\x8F".force_encoding("cp1252"),
"\u0090" => "\x90".force_encoding("cp1252"),
@jstoks
jstoks / software.sh
Last active September 21, 2018 17:41
Setup New Developer
#!/bin/bash
echo "Manditory Installs"
echo 'Heroku Toolbelt - https://toolbelt.heroku.com/'
echo ''
echo "Recommended Installs"
echo "Chrome - https://www.google.com/chrome/browser/desktop/"
echo "iTerm2 - https://www.iterm2.com/"
echo 'Postman - https://getpostman.com'