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
var fs = require('fs'); | |
var apiKey = "api-key"; | |
var bitcodin = require('bitcodin')(apiKey); | |
var promise = bitcodin.job.getDetails(1); | |
promise.then(function (data) { | |
console.log(data); | |
}); | |
} |
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
# Rack middleware to return 200 if service is up | |
# | |
# Usage: | |
# | |
# GET /hb | |
# | |
# GET /db | |
# | |
class HeartBeat | |
OK = [200, {"Content-Type" => "text/plain"}, []].freeze |
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
class BasePresenter | |
CACHE_TTL = 600 | |
def initialize(resource, includes, flag) | |
@resource = resource | |
@includes = includes | |
@flag = flag | |
end | |
private |
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
#!/usr/bin/env ruby | |
# | |
# Ruby script to download a number of files | |
# from individual URLs via HTTP/HTTPS/FTP | |
# specified in an external file. | |
# | |
# Author: Tobias Preuss | |
# Revision: 2013-04-18 16:26 +0100 UTC | |
# License: Creative Commons Attribution-ShareAlike 3.0 Unported |
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
# /opt/elasticbeanstalk/containerfiles/envvars | |
# Default environment variables for Elastic Beanstalk | |
export EB_ROOT=/opt/elasticbeanstalk | |
export EB_CONFIG_FILE=$EB_ROOT/deploy/configuration/containerconfiguration | |
export EB_CONFIG_SOURCE_BUNDLE=$EB_ROOT/deploy/appsource/source_bundle | |
export EB_CONFIG_APP_BASE=/var/app | |
export EB_CONFIG_APP_SUPPORT=$EB_CONFIG_APP_BASE/containerfiles | |
export EB_CONFIG_APP_ONDECK=$EB_CONFIG_APP_BASE/ondeck | |
export EB_CONFIG_APP_CURRENT=$EB_CONFIG_APP_BASE/current |
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
# spec/support/login_helper.rb | |
module LoginHelpers | |
def login_admin | |
before(:each) do | |
@request.env["devise.mapping"] = Devise.mappings[:user] | |
sign_in create(:admin) # Using factory girl as an example | |
end | |
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
container_commands: | |
01_fix_static_cors: | |
command: "/tmp/fix_static_cors.sh" | |
files: | |
"/tmp/fix_static_cors.sh": | |
mode: "000755" | |
owner: root | |
group: root | |
content: | | |
#!/bin/bash |
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
class Account < ActiveRecord::Base | |
def self.search(name = nil) | |
# search logic | |
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
<% flash.each do |type, message| %> | |
<div class="alert <%= bootstrap_class_for(type) %> fade in"> | |
<button class="close" data-dismiss="alert">×</button> | |
<%= message %> | |
</div> | |
<% 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
# Sample module you can include in a rake task that checks a pid file before running | |
# Usage: | |
# require 'task' | |
# | |
# class Job | |
# include Task | |
# end | |
module Task | |
def self.included(base) | |
base.extend(ClassMethods) |