First install the required gems:
gem install octokit awesomeprint rainbow
Then run it to extract all of your open GitHub issues into files (with comments).
ruby my-gh-issues.rb
#models/my_thing.rb | |
class MyThing < ActiveRecord::Base | |
belongs_to :user | |
acts_as_activity :user | |
end | |
#views/activities/_unhandled_item.html.haml | |
- case activity.item_type | |
- when 'MyThing' | |
="created a MyThing: #{link_to(activity.item.name, user_my_thing_path(activity.item.user, activity.item))}" |
# Lets you define relations between ActiveRecord and Mongo objects | |
module MongoRelations | |
module InstanceMethods | |
# get an object representing the MongoMapper equivalent of this object | |
# for the purpose of access relations on the object | |
fattr(:mongo_obj) do | |
res = klass.mongo_class.new | |
my_id = id | |
res.class_eval do |
#!/bin/bash | |
# Git status in git projects.... | |
# in your .bashrc file: | |
# if [ -f ~/.prompt ]; then | |
# . ~/.prompt | |
# fi | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
BLUE="\[\033[0;34m\]" |
First install the required gems:
gem install octokit awesomeprint rainbow
Then run it to extract all of your open GitHub issues into files (with comments).
ruby my-gh-issues.rb
# autoload concerns | |
module YourApp | |
class Application < Rails::Application | |
config.autoload_paths += %W( | |
#{config.root}/app/controllers/concerns | |
#{config.root}/app/models/concerns | |
) | |
end | |
end |
# https://gist.github.com/1214052 | |
require 'sinatra/base' | |
class ResqueWeb < Sinatra::Base | |
require 'resque/server' | |
use Rack::ShowExceptions | |
if CFG[:user].present? and CFG[:password].present? | |
Resque::Server.use Rack::Auth::Basic do |user, password| | |
user == CFG[:user] && password == CFG[:password] |
apps/web/application.rb
controller.prepare do
use YourApp::WardenImpl::WebManager
include YourApp::WardenImpl::WardenHelper
authentication_via :web_strategy
auth_failure_to "/login"
before :authenticate! # run an authentication before callback
end
#!/bin/bash | |
# Run containers as if they are locally installed tools. | |
# This is useful for images such as "python" or "maven". | |
# Edit the "image" variable and place in your ~/bin directory. | |
# For "Docker Desktop for Windows" under these environments: | |
# * WSL: if /c is mounted to C: and run from a dir under /c, but /tmp and $HOME volumes should be removed. | |
# * Msys/GitBash: but /tmp volume should be removed. | |
# * Cygwin: Will not work as-is due to path differences. |