> require 'ap'
> ap 1.methods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Find and replace by a given list of files supporting multiline matching. | |
# | |
# Usage: replace "find_pattern" "replace_with" **/*.rb | |
find_this="$1" | |
shift | |
replace_with="$1" | |
shift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1 | |
class SomeOrganizer | |
include Interactify | |
organize \ | |
self.if(:key_set_on_context, | |
self.chain(DoThingA, ThenB, ThenC), | |
self.chain(DoDifferentThingB, ThenDifferentC) | |
), | |
EitherWayDoThis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
branch=${1:-$(current-branch)} | |
base_branch=${2:-develop} | |
# git push --force-with-lease || git push --set-upstream origin $branch | |
mkdir -p tmp/.github | |
VIM_FILE='tmp/.github/pr.md' | |
rm -f tmp/.github/pr.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am markburns on github. | |
* I am markburns (https://keybase.io/markburns) on keybase. | |
* I have a public key ASBr1rTAPuZ3Ckll7M_n6ba4hmpKz9C9U7dcJNZ5yMs87Ao | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'parser/current' | |
require 'active_support/all' | |
require 'rspec' | |
require 'byebug' | |
require 'pstore' | |
module FsCaching | |
def store | |
@store ||= PStore.new(".gem_problems.pstore") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const values = [true, false, 1, 0, -1, "true", "false", "1", "0", "-1", "", undefined, Infinity, -Infinity, [], {}, [[]], [0], [1], NaN] | |
values.forEach(function(v){ | |
values.forEach(function(v2){ | |
var same = ((v==v2)==(v2==v)); | |
if(!same){ console.log(v, v2, same)} | |
}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module PrisonBreak | |
class Visit | |
attr_accessor :free_prisoner | |
attr_reader :prison, :payload | |
DISABLED_SYMBOLS = %w{, ` ( ? ! + <<} | |
DISABLED_WORDS = %w{send eval system exec popen rm puts require new load create file include free call push concat irb } | |
GUARD_RE = Regexp.new((DISABLED_SYMBOLS + DISABLED_WORDS).map {|i| Regexp.escape(i) }.join('|')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SomeClass | |
SomeClass == self | |
def self.a_class_method(options) | |
SomeClass == self | |
end | |
class << self | |
SomeClass.singleton_class == self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/lint_spec.rb | |
require "rails_helper" | |
RSpec.describe "Lint" do | |
it "FactoryGirl" do | |
should_run = directory_changed?("spec/factories") || directory_changed?("db") | |
next unless should_run | |
FactoryGirl.lint |
NewerOlder