A quick guide on how to setup Node.js development environment.
Previous versions of these install instructions had been tested with:
| class API::V1::BaseController < ApplicationController | |
| skip_before_filter :verify_authenticity_token | |
| before_filter :cors_preflight_check | |
| after_filter :cors_set_access_control_headers | |
| def cors_set_access_control_headers | |
| headers['Access-Control-Allow-Origin'] = '*' | |
| headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS' |
| source 'http://rubygems.org' | |
| # app base | |
| gem 'logger' | |
| gem 'rack' | |
| gem 'sinatra' | |
| gem 'sinatra-assetpack' | |
| gem 'sprockets' | |
| gem 'sprockets-helpers' |
| class ActionDispatch::Routing::Mapper | |
| def draw(routes_name) | |
| instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) | |
| end | |
| end | |
| BCX::Application.routes.draw do | |
| draw :api | |
| draw :account | |
| draw :session |
| class V | |
| include ActiveSupport::Callbacks | |
| define_callbacks :derp | |
| set_callback :derp, :after, :after_derp | |
| attr_accessor :x | |
| def derp | |
| run_callbacks :derp do | |
| @x = 1 | |
| puts @x | |
| end |
| module Spree::ReimbursementType::ExtendedOriginalPayment | |
| def self.included(base) | |
| class << base | |
| include ClassMethods | |
| end | |
| end | |
| module ClassMethods | |
| def reimburse(reimbursement, return_items, simulate) | |
| if simulate |
| #!/usr/bin/env ruby | |
| #/ Usage: <progname> [options]... | |
| #/ How does this script make my life easier? | |
| # ** Tip: use #/ lines to define the --help usage message. | |
| $stderr.sync = true | |
| require 'optparse' | |
| # default options | |
| flag = false | |
| option = "default value" |
| import { Component } from "React"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| constructor() { | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { | |
| this.setState({ data: 'Hello' }); | |
| } | |
| render() { |
| import Html exposing (text) | |
| import List exposing (concatMap, filter) | |
| import List.Extra exposing (uniqueBy) | |
| type alias CityId = Int | |
| type alias City = | |
| { id: CityId | |
| , name: String | |
| } |
A quick guide on how to setup Node.js development environment.
Previous versions of these install instructions had been tested with:
| for region in `aws ec2 describe-regions --output text | cut -f3` | |
| do | |
| echo -e "\nListing Instances in region:'$region'..." | |
| aws ec2 describe-instances --region $region | |
| done |