Skip to content

Instantly share code, notes, and snippets.

@joelbyler
joelbyler / rubocop.yml
Created July 19, 2019 20:01
lint-only cops
AllCops:
Exclude:
- 'db/schema.rb'
DisabledByDefault: true
StyleGuideBaseURL: https://shopify.github.io/ruby-style-guide/
Lint/AssignmentInCondition:
Enabled: true
@joelbyler
joelbyler / pre-commit
Last active February 14, 2017 02:32 — forked from wacko/pre-commit
Git hook to avoid commit debug lines (binding.pry console.log debugger...)
#!/usr/bin/env ruby
# Validates that you don't commit forbidden keywords to the repo
# You can skip this checking with 'git commit --no-verify'
exit 0 if ARGV.include?('--no-verify')
# Update this list with your own forbidden keywords
KEYWORDS = %w(binding.pry console.log debugger IO.puts)
def red(text) "\033[31m#{text}\033[0m"; end
@joelbyler
joelbyler / README.md
Created January 20, 2017 14:09 — forked from xavriley/README.md
Original NES Mario Theme for Sonic Pi

Making Chiptune Music using Sonic Pi v2.0

Warning: this might not work on a RaspberryPi yet

I was curious about making retro gaming sounds using Sonic Pi. A couple of months and a lot of Googling later, here's the original Mario Bros theme as it was heard on the NES console.

I'm (just about) old enough to remember rushing home from school to play this game at Philip Boucher's house, sitting cross-legged in front of the TV till my feet got pins and needles. Working out how to recreate it for Sonic Pi was a lot of fun!

Getting the sounds of the NES chip

@joelbyler
joelbyler / dad_status_indicator.md
Last active August 25, 2016 13:28
Dad's Busy Status

Add your Particle Photon to the site below (it should come with instructions for how to do this) https://build.particle.io/

Create a 'New App' in the particle online IDE (build) and copy / paste the file below. I can't remember, you may need to add the header file rgb-controls/rgb-controls.h to your 'App' in the IDE as well

Sign up or login to IFTTT and create new recipes, you'll need to create a Maker Key or something here, its been a while since I've been thru this.

Its hard to show what these look like in a gist but I'll try:

@joelbyler
joelbyler / mov_to_gif.md
Last active May 2, 2017 14:38
Change quick time movie to animated gif

Sometimes I like to do screen capture with quicktime because its already installed on my mac.

And then sometimes I want to take the resulting video (.mov file) and attach it to a PR on github (animated .gif)

You can use this command to make the conversion, adjust and configure to suite your own needs.

ffmpeg -i orig.mov -s 640x360 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=6 > final3.gif

OR

<html>
<head>
<title>Dad's Status</title>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha256-KXn5puMvxCw+dAYznun+drMdG1IFl3agK0p/pqT9KAo= sha512-2e8qq0ETcfWRI4HJBzQiA3UoyFk6tbNyG+qSaIBZLyW9Xf3sWZHN/lxe9fTh1U45DpPf07yj94KsUHHWe4Yk1A==" crossorigin="anonymous"></script>
</head>
<body>
<br/>
<div class="container">
require 'rspec'
class GameOfLife
def self.will_live?(alive_or_dead, neighbors)
if alive_or_dead == :alive
return true if neighbors == 2 || neighbors == 3
else
return true if neighbors == 3
end
false
@joelbyler
joelbyler / tmux_cheatsheet.md
Last active November 3, 2015 13:44 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@joelbyler
joelbyler / vim_cheatsheet.md
Last active November 25, 2019 04:17
List of good VIM commands

Cursor movement

  • h - move left
  • j - move down
  • k - move up
  • l - move right
  • w - jump by start of words (punctuation considered words)
  • W - jump by words (spaces separate words)
  • e - jump to end of words (punctuation considered words)
  • E - jump to end of words (no punctuation)
  • b - jump backward by words (punctuation considered words)
@joelbyler
joelbyler / blink.css
Created September 18, 2015 15:24
CSS Blink