THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
| Our file structure per single mini-application: | |
| app_starter.js.coffee | |
| --- app_directory | |
| --- app.module.js.coffee | |
| --- backend.module.js.coffee | |
| --- components | |
| --- component_file1.module.js.coffee | |
| ... | |
| --- domain.module.js.coffee | |
| --- glue.module.js.coffee |
| # backend app | |
| require 'sinatra/base' | |
| require 'json' | |
| class UsersController < Sinatra::Base | |
| get '/users/:id' do | |
| JSON.dump id: params[:id].to_i, name: "Josh" | |
| end | |
| end | |
| " Highlight long lines (>80) | |
| autocmd BufEnter * highlight OverLength ctermbg=darkgrey guibg=#592929 | |
| autocmd BufEnter * match OverLength /\%81v.*/ | |
| autocmd BufEnter * let w:long_line_match = 1 | |
| fu! LongLineHighlightToggle() | |
| highlight OverLength ctermbg=darkgrey guibg=#592929 | |
| if exists('w:long_line_match') | |
| match OverLength // |
| # Goal: put a non-Rails-aware Ruby library using normal `require`s in | |
| # lib/sim. Have it transparently reloaded between requests like Rails app | |
| # code is. | |
| # | |
| # The code here goes inside of your configure block in | |
| # config/environments/development.rb. There are two parts, commented inline. | |
| # Reload code whenever the simulator changes. | |
| config.watchable_dirs["lib/sim"] = [:rb] | |
| config.watchable_files << "lib/sim.rb" |
| module Wrapping | |
| def wrap(method_name, &block) | |
| # Alternative implementations: either will do the trick. | |
| wrap_with_prepend(method_name, &block) | |
| #wrap_with_bind(method_name, &block) | |
| end | |
| private | |
| def wrap_with_prepend(method_name) |
| TESTFLIGHT_APP_TOKEN=90210 | |
| TESTFLIGHT_TEAM_TOKEN=90210 | |
| TESTFLIGHT_API_TOKEN=90210 | |
| BUGSENSE_API_KEY=90210 | |
| BUGSENSE_API_TOKEN=90210 | |
| DEVELOPMENT_CERTIFICATE_NAME="iPhone Developer: yourName" | |
| DEVELOPMENT_PROVISIONING_PROFILE_PATH="/path/to/development.mobileprovision" | |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
| module InventoryItems(Command(..), Event(..), handle) where | |
| import Data.Maybe(isJust) | |
| type Id = String | |
| type Name = String | |
| type Amount = Int | |
| data Command = CreateInventoryItem Id | |
| | RenameInventoryItem Id Name |
| module Curryable | |
| def curry(arity=nil) | |
| method(:call).to_proc.curry(arity) | |
| end | |
| end | |
| class Foo | |
| include Curryable | |
| def call(x, y, z) |
| task :outdated => :environment do | |
| include ActionView::Helpers::DateHelper | |
| regexp = /\* ([^ ]+) \((\S+) > ([^)]+)\)/ | |
| outdated = `bundle outdated`.scan(regexp) | |
| outdated.each do |gem_name, available, current| | |
| data = JSON.parse(`curl --silent https://rubygems.org/api/v1/versions/#{gem_name}.json`) | |
| version = data.find { |e| e['number'] == current } | |
| age = distance_of_time_in_words_to_now(Time.parse(version['built_at'])) | |
| puts " * #{gem_name}: (#{available} > #{current}, built #{age} ago)" | |
| end |