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'); | |
function artifactOutput(imagePath) { | |
return '\033]1338;url=artifact://' + imagePath + ';alt=' + imagePath + '\07\n'; | |
} | |
function base64Output(imagePath) { | |
var encodedImage = fs.readFileSync(imagePath, {encoding: 'base64'}); | |
return '\033]1337;File=name=' + imagePath + ';inline=1:' + encodedImage + '\07\n'; | |
} |
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
#!/bin/bash | |
# Logs the queued and active stats from the application's sockets and posts to statsd | |
while true; do | |
proc_lines=`cat /proc/net/unix` | |
for file in /home/deploy/myapp/tmp/sockets/*.sock; do | |
# /proc/net/unix lines are of the format: |
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
$ ruby -rmemory_profiler -I. -e 'MemoryProfiler.report { require "config/environment" }.pretty_print' | |
Total allocated 2057572 | |
Total retained 390073 | |
allocated memory by gem | |
----------------------------------- | |
activesupport-4.2.1 x 60094221 | |
sprockets-3.0.1 x 56626099 | |
2.2.0/lib x 28225732 | |
rubygems x 13918784 |
This file has been truncated, but you can view the full file.
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
["", nil] | |
[".coffee", "application/javascript"] | |
[".jst", "application/javascript"] | |
[".eco", "application/javascript"] | |
[".ejs", "application/javascript"] | |
[".sass", "text/css"] | |
[".scss", "text/css"] | |
[".erb", "text/plain"] | |
[".jsx", "application/javascript"] | |
[".cjsx", nil] |
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
FROM ruby:2.2.0 | |
# Add official postgresql apt deb source | |
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 | |
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list | |
# Update all the things | |
RUN apt-get update | |
# Generate UTF-8 locale |
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
app: | |
build: . | |
links: | |
- db:db | |
- redis:redis | |
- memcache:memcache | |
volumes: | |
- ./:/app | |
environment: | |
PGHOST: db |
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
# via https://github.com/halostatue/mime-types/pull/93#issuecomment-87814894 | |
require 'allocation_tracer' | |
require 'pretty_print' | |
$LOAD_PATH << "/Users/schneems/Documents/projects/mime-types/lib" | |
ObjectSpace::AllocationTracer.setup(%i{path line type}) | |
r = ObjectSpace::AllocationTracer.trace do |
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
return function(request, next_middleware) | |
local next_response = next_middleware() | |
-- Modify these | |
local lifx_access_token = "xxx" | |
local bulb_selector = "id:xxx" | |
local webhook_token = "xxx" | |
-- The rest is standard and doesn't need to be modified | |
if request.headers["X-Buildkite-Token"] ~= webhook_token then |
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 bash | |
# An example Buildbox deploy script for automatically deploying branches of a | |
# site or application to different subdomains. So you can have an | |
# always-up-to-date copy of a branch being available at http://branch.dev.mysite.com/ | |
# | |
# This copies the currently checked out code to /var/www/<branch name>. You'd | |
# then configure your web server to dynamically map subdomains to /var/www. | |
# | |
# You could just as easily push the branch to Heroku or FTP it to a remote server. |
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
# Timezone extension to Sidetiq | |
Sidetiq::Schedulable::ClassMethods.class_eval do | |
# Sets the time zone for the recurrence rules. | |
# | |
# Example: | |
# | |
# class MyWorker | |
# include Sidekiq::Worker | |
# include Sidetiq::Schedulable | |
# |