Skip to content

Instantly share code, notes, and snippets.

Jeff Talbot nevernormal1

Block or report user

Report or block nevernormal1

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Close volumes
var closeVolume = function(pathVolume) {
var firstPoint, lastPoint, points;
if (pathVolume === null) {
return null;
}
points = pathVolume.shape.points;
if (points.length < 2) {
@nevernormal1
nevernormal1 / clipper.js
Last active Feb 14, 2019
Easel helper functions. Download this as a zip file and add dependencies to your app.
View clipper.js
// rev 452
/********************************************************************************
* *
* Author : Angus Johnson *
* Version : 6.1.3a *
* Date : 22 January 2014 *
* Website : http://www.angusj.com *
* Copyright : Angus Johnson 2010-2014 *
* *
* License: *
@nevernormal1
nevernormal1 / .block
Last active Mar 13, 2019
SVG Jigsaw Puzzle Generator
View .block
license: MIT
View gist:720445
#!/usr/bin/env ruby
def dump_items(items)
if items.size > 1
items.each_with_index do |item_to_print, i|
items.each_with_index do |related_item, j|
next if item_to_print == related_item
puts "#{item_to_print}:#{related_item}\t1"
end
end
View gist:377185
class << self
def image_styles
ActiveSupport::OrderedHash.new.tap do |styles|
styles[:original] = {:processors => [:slice]}
styles[:preview] = {:geometry => "100x100", :processors => [:thumbnail]}
end
end
end
has_attached_file :image,
View gist:366084
rds.create_db_snapshot(
:db_snapshot_identifier => 'test-snap',
:db_instance_identifier => '[production-instance]'
)
rds.restore_db_instance_from_snapshot(
:db_snapshot_identifier => 'test-snap',
:db_instance_identifier => 'clone',
:db_instance_class => 'db.m1.small'
)
View mysql_migration.sh
> mysqldump old_db -u user -p > inventables.sql
> mysql rds_db -u user -p -h [RDS_connection_string] < inventables.sql
View authorize.rb
db.authorize_db_security_group(:db_security_group_name => 'default', :ec2_security_group_name => '[our-ec2-security-group]', :ec2_security_group_owner_id => '[our-aws-account-number]')
View create_db_instance.rb
db = rds.create_db_instance(:db_instance_identifier => "[FILTERED]", :allocated_storage => 100, :db_instance_class => "db.m1.small", :engine => "MySQL5.1", :master_username => '[FILTERED]', :master_user_password => '[FILTERED]', :db_name => '[FILTERED]', :availability_zone => 'us-east-1c')
View gist:356787
db = rds.create_db_instance(
:db_instance_identifier => "[FILTERED]",
:allocated_storage => 100,
:db_instance_class => "db.m1.small",
:engine => "MySQL5.1",
:master_username => '[FILTERED]',
:master_user_password => '[FILTERED]',
:db_name => '[FILTERED]',
:availability_zone => 'us-east-1c'
)
You can’t perform that action at this time.