Skip to content

Instantly share code, notes, and snippets.

@dnagir
dnagir / rspec-syntax-cheat-sheet.rb
Created November 5, 2010 09:29
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@arika
arika / rails_erb_syntax_check.rb
Last active December 18, 2020 10:16
Rails(Action View) ERB template syntax checker
require 'action_view'
require 'ruby-beautify'
require 'ripper'
require 'tmpdir'
require 'fileutils'
require 'optparse'
def check_syntax(path, options = {})
erb = content(path)
code = ruby_code(erb)
@waylaidwanderer
waylaidwanderer / SteamBroadcastChatCleaner.user.js
Last active January 14, 2018 10:15
Steam Broadcast Chat Cleaner - cleans up the chat of any Steam Broadcast, massively increasing the conversation quality. Works on Dota 2's Watch page as well. Requires Greasemonkey (Firefox) or Tampermonkey (Chrome). Screenshots: http://i.imgur.com/7qEfM9B.png, http://i.imgur.com/PHW4TbK.png - Click "Raw" to install.
// ==UserScript==
// @name Steam Broadcast Chat Cleaner
// @namespace http://jzhang.net/
// @version 3.1.1
// @description Cleans up Steam Broadcast chat
// @author waylaidwanderer
// @include http://steamcommunity.com/broadcast/watch/*
// @require //code.jquery.com/jquery-1.11.3.min.js
// @downloadURL https://gist.github.com/waylaidwanderer/6bb095e0731ef41d49dc/raw/SteamBroadcastChatCleaner.user.js
// @updateURL https://gist.github.com/waylaidwanderer/6bb095e0731ef41d49dc/raw/SteamBroadcastChatCleaner.user.js
@csexton
csexton / neopixel.c
Created April 2, 2021 18:02
NeoPixel light sequences with a serial USB interface
// Based on the NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// Released under the GPLv3 license to match the rest of the
// Adafruit NeoPixel library
// Simple interface to run light sequences based on a single character
// code over serial over usb. Makes the interface on linux look something
// like this:
//
// echo -n 'a' > /dev/cu.usbmodem123
//