This file contains 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
const { ApiUnauthorized, ApiForbidden, ApiBaseError } = require('./lib/errors'); | |
class ReportsService { | |
static async getOrganizationDetails({ orgId, container }) { | |
const response = await fetch(); | |
switch (response.status) { | |
case 401: throw new ApiUnauthorized(response); | |
case 403: throw new ApiForbidden(response); | |
default: throw new ApiBaseError(response); |
This file contains 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
class JwtCurrent < ActiveSupport::CurrentAttributes | |
attribute :jwt | |
end | |
# in api_controller.rb | |
def some_action | |
JwtCurrent.jwt = "something" | |
future = Concurrent::Future.execute do | |
puts "*" * 50 |
This file contains 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
# Reference http://stackoverflow.com/a/18490935/2037928 | |
# Login as root | |
# Install needed packages | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev | |
cd /tmp | |
# Download appropriate ruby version https://www.ruby-lang.org/en/downloads/ |
This file contains 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
- VM10034:1 0ef9755629d2.js:2 | |
Uncaught Error: Internal error on method getCurrentObject | |
(anonymous function) | |
d | |
- VM10040:1 0ef9755629d2.js:2 | |
Uncaught Error: Internal error on method getCurrentObject | |
(anonymous function) | |
d |
This file contains 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
#!/bin/bash | |
# Takes one parameter: a remote git repository URL. | |
# | |
# This is the stuff this script does: | |
# | |
# 1. Clones the repository | |
# 2. Fetches all remote branches | |
# 3. Compresses the folder | |
# 4. Deletes the cloned folder. |
This file contains 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
require 'capistrano_colors' | |
require 'capistrano/ext/multistage' | |
require 'bundler/capistrano' | |
require "rvm/capistrano" | |
require 'sidekiq/capistrano' | |
set :rvm_type, :system | |
set :rvm_ruby_string, :release_path | |
before 'deploy:setup', 'rvm:install_ruby' |
This file contains 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 is a manifest file that'll be compiled into application.js, which will include all the files | |
// listed below. | |
// | |
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, | |
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. | |
// | |
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the | |
// the compiled file. | |
// | |
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD |
This file contains 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
class User < ActiveRecord::Base | |
scope :with_first_name, lambda { |first_name| where(:first_name => first_name) } | |
def self.with_last_name(last_name) | |
where(:last_name => last_name) | |
end | |
end |
- Install XCode command line tools
- Install GCC with brew as suggested in this stack overflow:
NewerOlder