Skip to content

Instantly share code, notes, and snippets.

View fzf's full-sized avatar

Fletcher Fowler fzf

View GitHub Profile
@fzf
fzf / routes.rb
Last active December 11, 2015 22:29
api_version(:module => "Api::V1", :path => {:value => "api/v1"}, :default => true) do
end
events GET /events(.:format) events#index
api_v1_events GET /api/v1/events(.:format) Api::V1/events#index
GET /events(.:format) Api::V1/events#index
@fzf
fzf / konami.js
Last active December 19, 2015 13:09
$(function () {
// konami code - up up down down left right left right b a
var konami = String.fromCharCode(38, 38, 40, 40, 37, 39, 37, 39, 66, 65);
var codeBuffer = "";
$(document).keyup(function (e) {
codeBuffer += String.fromCharCode(e.which);
if (konami.substring(0, codeBuffer.length) == codeBuffer) {
if (konami.length == codeBuffer.length) {
ba();
}
var CommentController = {
current_users: [],
create: function(req, res) {
current_users.push('yada');
}
}
module.exports = CommentController;
@fzf
fzf / boards.rb
Last active February 11, 2020 18:15
VALID_BOARD = [
[1,2,3, 4,5,6, 7,8,9],
[4,5,6, 7,8,9, 1,2,3],
[7,8,9, 1,2,3, 4,5,6],
[2,3,4, 5,6,7, 8,9,1],
[5,6,7, 8,9,1, 2,3,4],
[8,9,1, 2,3,4, 5,6,7],
[3,4,5, 6,7,8, 9,1,2],
class MyClass
include Scientist
def count
science('new_count') do |experiment|
experiment.context(user: user)
experiment.use { 1 }
# One Try
experiment.try { 2 }
for a in tv/*/; do (cd "$a" && for f in *; do mv $f $(basename $(pwd)).${f##*.}; done); done