🏄♂️
- GitHub Staff
- rickwinfrey.com
- @rewinfrey.bsky.social
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
" Maintained by Rick Winfrey " heavily borrowed from Vincent Driessen's .vimrc file: https://raw.github.com/nvie/vimrc/master/vimrc | |
" and http://stevelosh.com/blog/2010/09/coming-home-to-vim/#scratch | |
set nocompatible | |
call pathogen#infect() | |
call pathogen#helptags() | |
filetype off " force reloading *after* pathogen loaded | |
filetype plugin indent on " enable detection, plugins and indenting in one step | |
syntax on |
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 IsSelf | |
def what_is_self? | |
puts "self = #{self.inspect}" | |
puts "self's class = #{self.class}" | |
end | |
end | |
class AClass | |
include IsSelf | |
def initialize |
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
$:.unshift File.expand_path('../lib/', __FILE__) | |
require 'ttt/setup' | |
require 'rake' | |
require 'rake/testtask' | |
desc "Running Core Lib specs" | |
task :lib_specs do | |
system 'bash -l -c "rvm use default"' | |
system('rspec spec') | |
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
class MyStruct | |
def self.new(*method_names, &block) | |
raise ArgumentError, "wrong number of arguments (0 for 1+)" if method_names.empty? | |
Class.new do | |
class_eval &block if block | |
include Enumerable | |
def initialize(*args) |
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
mysql -u root -p | |
mysql> use mysql; | |
mysql> create database empire; | |
mysql> grant all privileges on empire.* to ''@localhost; | |
mysql> flush privileges; |
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
curl -XDELETE 'http://localhost:9200/watbro' && curl -XPUT 'localhost:9200/watbro' -d '{"settings":{"analysis": {"analyzer": {"state":{"type": "pattern","pattern":"\\s"}}}}}' | |
curl 'localhost:9200/watbro/_analyze?pretty=1&analyzer=state&filter=state_strip' -d 'Mountain Village, AK' |
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
sudo gem install debugger-ruby_core_source -v 1.1.6 | |
bundle --deployment |
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
@buildForm: (options) -> | |
form = $("<form></form>") | |
form.attr('method', options.method) | |
form.attr('action', options.action) | |
form.attr('target', options.target) | |
csrf_token = $('meta[name=csrf-token]').attr('content') | |
csrf_param = $('meta[name=csrf-param]').attr('content') | |
options[csrf_param] = csrf_token | |
for key, value of options.params | |
input = $('<input></input>') |
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
bundle exec rails runner 'require "./db/fixtures/production_ready/007_city_zipcodes"' |
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
role_name = "featured_provider" | |
role = Authorization::Role.create(name: "featured_provider") | |
role.add_permission!(:'account:provider:featured') | |
Authorization::Role.add_member_to_role(member, role_name) |