Skip to content

Instantly share code, notes, and snippets.

View idyll's full-sized avatar
👾
pushing bits.

Mark Madsen idyll

👾
pushing bits.
View GitHub Profile
@idyll
idyll / heroku.rake
Created February 17, 2012 21:08 — forked from alloy/heroku.rake
Some simple Heroku deploy rake tasks.
namespace :heroku do
namespace :deploy do
task :tag do
rev = `git rev-parse HEAD`.strip
if `git describe --contains #{rev} 2>&1`.include?('cannot describe')
version = Time.new.strftime("%Y%m%d%H%M%S")
sh "git tag -a heroku-#{version} -m 'Deploy version to Heroku: #{version}'"
sh "git push origin master"
sh "git push origin master --tags"
else
## The quick-and-nasty CVE-2013-0156 Heroku inspector!
## Originally brought to you by @elliottkember with changes by @markpundsack @ Heroku
## Download and run using:
## ruby heroku-CVE-2013-0156.rb
`heroku list`.split("\n").each do |app|
app = app.strip
# Some "heroku apps" lines have === formatting for grouping. They're not apps.
next if app[0..2] == "==="
@idyll
idyll / README.md
Created June 20, 2013 20:40 — forked from croaky/README.md

Rails app

is a Rails 3.1 app running on Ruby 1.9.2 and deployed to Heroku's Cedar stack. It has an RSpec and Cucumber test suite which should be run before commiting to the master branch.

Running tests

Create aliases:

/****** Current Format ******/
// Basic Message
metadata = {
id: 1234234234, // Randomly generated by the client. Used for receiving success/fail callbacks
client_id: 123456 // Sent from the server with the `websocket_rails.client_connected` event which is sent after the connection is opened. Store this and send it with each message.
data: {name: 'shoes'} // Arbitrary data. Can be Object or String. This is available through #message or #data in the controller.
}
event = ["products.new", metadata]
@idyll
idyll / redis.yml
Created January 13, 2014 04:55 — forked from xxx/redis.yml
defaults:
:port: 6379
:host: localhost
development:
:db: 2
:namespace: development
# force use of Redis::Distributed
:host:
- localhost
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user;killall Finder;echo "Open With has been rebuilt, Finder will relaunch"
require 'pdf-reader'
#doc = PDF::Reader.new(File.expand_path('~/Desktop/note-example.pdf'))
doc = PDF::Reader.new(File.expand_path('./book-mw-read-thru.pdf'))
$objects = doc.objects
def is_note?(object)
object[:Type] == :Annot && object[:Subtype] == :Text
end
@idyll
idyll / Dockerfile
Created September 2, 2016 15:09 — forked from bitwalker/Dockerfile
Release container image
FROM bitwalker/alpine-erlang:latest
MAINTAINER Paul Schoenfelder <paulschoenfelder@gmail.com>
ENV REFRESHED_AT=2016-06-21 \
HOME=/opt/app/ \
MIX_ENV=prod \
TERM=xterm \
APP=myapp \
APPVER=0.1.0