This file contains hidden or 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 SecureEndpointHelper | |
| extend ActiveSupport::Concern | |
| included do | |
| include Devise::TestHelpers | |
| before do | |
| request.env["devise.mapping"] = Devise.mappings[:user] | |
| setup_controller_for_warden | |
| end | |
| end |
This file contains hidden or 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
| PIVOTAL = { | |
| :token => 'your_token', | |
| :project_id => 'your_project_id' | |
| } | |
| namespace :pivotal do | |
| task :deliver_all_finished => :environment do | |
| line = Cocaine::CommandLine.new("curl", "-H 'X-TrackerToken: #{PIVOTAL[:token]}' -X PUT https://www.pivotaltracker.com/services/v3/projects/#{PIVOTAL[:project_id]}/stories/deliver_all_finished -d ''") | |
| puts "Running #{line.command}" | |
| line.run |
This file contains hidden or 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
| # This file is copied to spec/ when you run 'rails generate rspec:install' | |
| ENV["RAILS_ENV"] ||= 'test' | |
| require File.expand_path("../../config/environment", __FILE__) | |
| require 'rspec/rails' | |
| require 'rspec/autorun' | |
| # Requires supporting ruby files with custom matchers and macros, etc, | |
| # in spec/support/ and its subdirectories. | |
| Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} |
This file contains hidden or 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
| CarrierWave.configure do |config| | |
| config.storage = :s3 | |
| config.s3_access_key_id = "s3_access_key_id" | |
| config.s3_secret_access_key = "s3_secret_access_key" | |
| config.s3_bucket = "s3_bucket" | |
| # config.s3_access_policy = :authenticated_read | |
| config.s3_cnamed = true | |
| end |
This file contains hidden or 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
| # How Clearance / Hoptoad does it | |
| module Clearance | |
| class << self | |
| attr_accessor :configuration | |
| end | |
| def self.configure | |
| self.configuration ||= Configuration.new | |
| yield(configuration) | |
| end |
This file contains hidden or 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
| [user] | |
| name = SengMing Tan | |
| email = email@example.com | |
| [alias] | |
| b = branch | |
| c = commit . | |
| co = checkout | |
| stat = status | |
| s = status | |
| h = log --pretty=format:'%Cblue%h %Cgreen %ar%Creset %s' |
This file contains hidden or 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
| { | |
| "auto_complete": true, | |
| "color_scheme": "Packages/User/Monokai Soda.tmTheme", | |
| "draw_white_space": "all", | |
| "font_face": "Monaco", | |
| "font_size": 13.0, | |
| "highlight_line": true, | |
| "highlight_modified_tabs": true, | |
| "ignored_packages": | |
| [ |
This file contains hidden or 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
| javascript:(function(){function%20hex_md5(p){return%20binl2hex(core_md5(str2binl(p),p.length*8));}function%20core_md5(x,len){x[len>>5]|=0x80<<((len)%2532);x[(((len+64)>>>9)<<4)+14]=len;var%20a=1732584193;var%20b=-271733879;var%20c=-1732584194;var%20d=271733878;for(var%20i=0;i<x.length;i+=16){var%20olda=a;var%20oldb=b;var%20oldc=c;var%20oldd=d;a=md5_ff(a,b,c,d,x[i+0],7,-680876936);d=md5_ff(d,a,b,c,x[i+1],12,-389564586);c=md5_ff(c,d,a,b,x[i+2],17,606105819);b=md5_ff(b,c,d,a,x[i+3],22,-1044525330);a=md5_ff(a,b,c,d,x[i+4],7,-176418897);d=md5_ff(d,a,b,c,x[i+5],12,1200080426);c=md5_ff(c,d,a,b,x[i+6],17,-1473231341);b=md5_ff(b,c,d,a,x[i+7],22,-45705983);a=md5_ff(a,b,c,d,x[i+8],7,1770035416);d=md5_ff(d,a,b,c,x[i+9],12,-1958414417);c=md5_ff(c,d,a,b,x[i+10],17,-42063);b=md5_ff(b,c,d,a,x[i+11],22,-1990404162);a=md5_ff(a,b,c,d,x[i+12],7,1804603682);d=md5_ff(d,a,b,c,x[i+13],12,-40341101);c=md5_ff(c,d,a,b,x[i+14],17,-1502002290);b=md5_ff(b,c,d,a,x[i+15],22,1236535329);a=md5_gg(a,b,c,d,x[i+1],5,-165796510);d=md5_gg(d,a,b,c, |
This file contains hidden or 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
| function mkdev; rm -f ~/dev; and ln -vs $PWD ~/dev; end |
This file contains hidden or 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
| namespace :download do | |
| DownloadPath = Pathname.new('Downloads') | |
| ListFile = DownloadPath + 'list' | |
| task :all do | |
| ListFiles = Pathname.glob('Downloads/**/list') | |
| next if ListFiles.empty? | |
| ListFiles.each do |listfile| | |
| list = listfile.read.split.compact.reject(&:empty?) |