Skip to content

Instantly share code, notes, and snippets.

View bunnymatic's full-sized avatar
💭
writing computer programs

Mr Rogers bunnymatic

💭
writing computer programs
View GitHub Profile
Create bookmark and drop this in the URL field
javascript:!function(){let e,t=["kevinhyunilkim","rhkwong","yingyingchoi","t3ly","roger-mo-gusto","julieqdchen-gusto","Lizard381","jaguar1014"];function n(){if(t.length>0){const e=t.shift();document.getElementById("review-filter-field").value=e,document.getElementById("review-filter-field").dispatchEvent(new Event("focus"));let i=0;const s=function(){let t=document.querySelectorAll(".filterable-active .select-menu-item"),c=null;t.forEach(function(t){-1!==t.textContent.toLowerCase().indexOf(e.toLowerCase())&&(c=t)}),c?(c.click(),setTimeout(n,200)):i%3E8?setTimeout(n,200):(i++,setTimeout(s,500))};s()}else%20document.querySelectorAll(%22.sidebar-assignee.js-discussion-sidebar-item%20summary%22)[0].click(),e.parentNode.removeChild(e)}function%20i(){const%20e=function(){const%20t=document.querySelectorAll(%22.select-menu-list%20.select-menu-item%22).length;null==document.querySelector(%22.js-discussion-sidebar-menu%20.select-menu-header%22).offsetParent&&document.que
@bunnymatic
bunnymatic / delegators.rb
Created February 27, 2020 16:25
ruby delegator
#!/usr/bin/env ruby
# require 'pry'
# require 'byebug'
module DelegateMe
def delegate_methods(methods, to:)
[methods].flatten.each do |method_name|
define_method method_name do |*arg, &block|
base = send(to)
@bunnymatic
bunnymatic / pull_request_simple.md
Last active March 9, 2021 15:43
Pull Request Template

Fixes issue(s) # .

Changes proposed in this pull request:

/cc relevant people

@bunnymatic
bunnymatic / lint-fix-on-save.el
Created December 17, 2018 08:21
Emacs routines to auto lint fix (prettier and rubocop) on save
(defun is-ruby-file (f)
(if (string-match "\\.rb$" f)
t
nil
))
(defun is-javascript-file (f)
(if (or
(string-match "\\.jsx?$" f)
(string-match "\\.json$" f))
@bunnymatic
bunnymatic / info.md
Last active July 11, 2018 15:13
Axios vs Fetch
@bunnymatic
bunnymatic / io_inspector.ex
Created December 11, 2017 02:12
Elixir Inspector
defmodule Inspector do
def inspector(v,s), do: (IO.puts("[#{s}] #{inspect(v)}"); v)
def inspector(v), do: (IO.puts("[check] #{inspect(v)}"); v)
end
module Capybara
class Session
def has_flash?(kind, msg)
within ".alert-#{kind}" do
has_content?(msg)
end
end
end
end
@bunnymatic
bunnymatic / features-support-elasticsearch.rb
Created January 13, 2016 08:41
Elasticsearch test helpers
require_relative "../../spec/support/test_es_server"
require_relative "./webmock"
TestEsServer.start
at_exit do
TestEsServer.stop
end
@bunnymatic
bunnymatic / sayit.rb
Last active November 18, 2015 06:23
run all the mac voices with a phrase
#!/usr/bin/env ruby
voices = [
"Agnes",
"Kathy",
"Princess",
"Vicki",
"Victoria",
"Bruce" ,
"Fred" ,
@bunnymatic
bunnymatic / jquery.cachedDataService.js
Last active August 29, 2015 14:27
jQuery Cached Ajax Data Service
window.CachedDataService = {
inProgress: {
},
ajax: function(ajaxOptions) {
var key = ajaxOptions.url + (JSON.stringify(ajaxOptions.data || ''))
if (this.inProgress[key]) {
return this.inProgress[key];
}
else {