Skip to content

Instantly share code, notes, and snippets.

@stream7
stream7 / mxSwimlaneLayout.js
Created November 7, 2017 16:48 — forked from davidjgraph/mxSwimlaneLayout.js
23.09.2013 Swimlane layout fix
/**
* $Id: mxSwimlaneLayout.js,v 1.3 2013/09/23 14:11:22 david Exp $
* Copyright (c) 2005-2012, JGraph Ltd
*/
/**
* Class: mxSwimlaneLayout
*
* A hierarchical layout algorithm.
*
* Constructor: mxSwimlaneLayout
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
#
# Update 2013-06-24: added -w0 option to prevent truncated lines
require 'base64'
data=`ioreg -l -w0 -d0 -r -c AppleDisplay`
@stream7
stream7 / dabblet.css
Created July 12, 2013 20:39 — forked from LeaVerou/dabblet.css
Flexible buttons with ems (duh!)
/**
* Flexible buttons with ems (duh!)
*/
body {
font-family: sans-serif
}
button {
padding: .5em .8em .4em;
@stream7
stream7 / a.md
Created December 16, 2012 20:15 — forked from rkh/a.md

This allows you to use the following video streaming services outside of the US from your Mac without having to use a proxy or VPN, so no big bandwidth issues:

  • Hulu / HuluPlus
  • CBS
  • ABC
  • MTV
  • theWB
  • CW TV
  • Crackle
  • NBC
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
@stream7
stream7 / paperclip_migration.rake
Created October 26, 2011 16:16 — forked from louisgillies/paperclip_migration.rake
Quick and dirty one off migration task for paperclip plugin to move files from local filesystem to Amazon S3.
# First configure your models to use Amazon s3 as storage option and setup the associated S3 config.
# Then add the classes your want to migrate in the klasses array below.
# Then run rake paperclip_migration:migrate_to_s3
# Should work but this is untested and may need some tweaking - but it did the job for me.
namespace :paperclip_migration do
desc "migrate files from filesystem to s3"
task :migrate_to_s3 => :environment do
klasses = [:model_1, :model_2] # Replace with your real model names. If anyone wants to this could be picked up from args or from configuration.
klasses.each do |klass_key|
# app/uploaders/avatar_uploader.rb
process :fix_exif_rotation
process :strip
process :resize_to_fill => [1024, 768]
process :quality => 90 # Percentage from 0 - 100
@stream7
stream7 / paperclip.rb
Created September 29, 2011 18:50 — forked from serek/paperclip.rb
Paperclip initializer for S3 Europe.
Paperclip.interpolates(:s3_eu_url) { |attachment, style|
"#{attachment.s3_protocol}://s3-eu-west-1.amazonaws.com/#{attachment.bucket_name}/#{attachment.path(style).gsub(%r{^/}, "")}"
}
require 'aws/s3'
AWS::S3::DEFAULT_HOST = "s3-eu-west-1.amazonaws.com"
@stream7
stream7 / index.html.slim
Created September 24, 2011 15:42 — forked from wlangstroth/index.html.slim
html5boilerplate in slim for rails
doctype html
/[if lt IE 7]
| <html class="no-js ie6 oldie" lang="en">
/[if IE 7]
| <html class="no-js ie7 oldie" lang="en">
/[if IE 8]
| <html class="no-js ie8 oldie" lang="en">
/[if gte IE 8]
| <html class="no-js" lang="en">
head
@stream7
stream7 / Gemfile
Created September 1, 2011 05:40 — forked from chriseppstein/readme.md
How to integrate Compass with Rails 3.1 asset pipeline
group :assets do
gem 'sass-rails', '~> 3.1.0'
gem 'coffee-rails', '~> 3.1.0'
gem 'uglifier'
gem 'compass', '~> 0.12.alpha'
end