Skip to content

Instantly share code, notes, and snippets.

@bryancusatis
bryancusatis / .bash_profile
Last active January 29, 2017 00:28 — forked from jernejcic/.bash_profile
.bash_profile file on Mac OS X
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases.
# Much of this was originally copied from:
# http://natelandau.com/my-mac-osx-bash_profile/
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
@bryancusatis
bryancusatis / weak_aura.lua
Created July 31, 2016 18:49
CalculateLast5Hits
function()
-- Main function to calc FR healing
local now = time()
local heal_value = 0
-- Versa
local VersatilityBonus = GetCombatRatingBonus(CR_VERSATILITY_DAMAGE_DONE) + GetVersatilityBonus(CR_VERSATILITY_DAMAGE_DONE)
-- Lazy:
VersatilityBonus = 1 + (VersatilityBonus/100)
var crypto = require("crypto");
var moment = require("moment")
var s3 = {
generateS3Policy: function (fileName) {
var s3Policy = {
'conditions': [
{'bucket': CONF.s3.bucket},
['starts-with', '$key', 'uploads/' + fileName],
{'acl': 'public-read'},
http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;
@bryancusatis
bryancusatis / us.json
Created March 4, 2013 16:23
us topology.js
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// this is a simple log action
function QueueActionLog(message) {
this.message = message || 'QueueActionLog :: got a action for job id(%s)';
this.apply = function(job) {
console.log(util.format(this.message, job.id));
return true;
};
}
@bryancusatis
bryancusatis / shipit.rake
Created November 9, 2012 19:17 — forked from taktran/shipit.rake
Ship it! rake task. Some details about the rationale here: http://blog.pebblecode.com/post/32263926012/ship-it
# Ship it! rake task
#
# Merge branch (master by default) to deployment branch, and deploy to server.
#
# Prerequisite:
#
# * Declare all deployment branches in `ALL_DEPLOYMENT_BRANCHES`
# * Declare deploy only branches in `DEPLOY_ONLY_BRANCHES` (ie, does not merge master)
# * Modify `Deploy.command` function as necessary
#
@bryancusatis
bryancusatis / git-prune-tags.rb
Created October 31, 2012 18:17 — forked from rlivsey/git-prune-tags.rb
Script to prune any tags which exist locally but not on the remote
#!/usr/bin/env ruby
require 'readline'
def prompt(prompt="> ")
input = nil
prompt += " " unless prompt =~ /\s$/
loop do
input = Readline.readline(prompt)
break if input.length > 0
end
@bryancusatis
bryancusatis / deploy.rake
Created October 30, 2012 20:58 — forked from njvitto/deploy.rake
Rakefile to deploy and rollback to Heroku in two different environments (staging and production) for the same app
#Deploy and rollback on Heroku in staging and production
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag]
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on]
@bryancusatis
bryancusatis / spec_helper.rb
Created September 17, 2012 16:25
Mongoid, DBCleaner, RSpec, no rails
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rspec'
require 'database_cleaner'
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.strategy = :truncation