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 |
| #!/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:
| # on the mastodon server | |
| cd /home/mastodon/live | |
| git checkout <release tag> | |
| docker-compose pull && docker-compose build && docker-compose stop | |
| # on the local machine | |
| rsync -trzv --delete --rsync-path='sudo rsync' [email protected]:/home/mastodon/live/ backup # get full backup | |
| cd backup | |
| docker-compose pull && docker-compose build && docker-compose run --rm web rails assets:precompile | |
| cd .. |
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'aws-sdk' | |
| class S3FolderUpload | |
| attr_reader :folder_path, :total_files, :s3_bucket, :include_folder | |
| attr_accessor :files | |
| # Initialize the upload class |