Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
writing computer programs

Mr Rogers bunnymatic

💭
writing computer programs
View GitHub Profile
View delegators.rb
#!/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 Aug 30, 2019
Pull Request Template
View pull_request_simple.md

Fixes issue(s) # .

Changes proposed in this pull request:

/cc relevant people

@bunnymatic
bunnymatic / lint-fix-on-save.el
Created Dec 17, 2018
Emacs routines to auto lint fix (prettier and rubocop) on save
View lint-fix-on-save.el
(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 Jul 11, 2018
Axios vs Fetch
View info.md
View io_inspector.ex
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
View rspec_misc_helpers.rb
module Capybara
class Session
def has_flash?(kind, msg)
within ".alert-#{kind}" do
has_content?(msg)
end
end
end
end
View features-support-elasticsearch.rb
require_relative "../../spec/support/test_es_server"
require_relative "./webmock"
TestEsServer.start
at_exit do
TestEsServer.stop
end
@bunnymatic
bunnymatic / sayit.rb
Last active Nov 18, 2015
run all the mac voices with a phrase
View sayit.rb
#!/usr/bin/env ruby
voices = [
"Agnes",
"Kathy",
"Princess",
"Vicki",
"Victoria",
"Bruce" ,
"Fred" ,
@bunnymatic
bunnymatic / jquery.cachedDataService.js
Last active Aug 29, 2015
jQuery Cached Ajax Data Service
View jquery.cachedDataService.js
window.CachedDataService = {
inProgress: {
},
ajax: function(ajaxOptions) {
var key = ajaxOptions.url + (JSON.stringify(ajaxOptions.data || ''))
if (this.inProgress[key]) {
return this.inProgress[key];
}
else {
You can’t perform that action at this time.