Skip to content

Instantly share code, notes, and snippets.

View tonkapark's full-sized avatar

Matt Anderson tonkapark

View GitHub Profile
@deepakkumarnd
deepakkumarnd / server_setup.sh
Last active October 8, 2024 00:49
Server setup script
# This script has to be run as a root user
echo "* Updating system"
apt-get update
apt-get -y upgrade
echo "* Installing packages"
apt-get -y install build-essential libmagickcore-dev imagemagick libmagickwand-dev libxml2-dev libxslt1-dev git-core nginx redis-server curl nodejs htop
id -u deploy &> /dev/null
if [ $? -ne 0 ]
@vicentereig
vicentereig / ruby_csv_simple_object_mapping.rb
Last active October 7, 2015 15:38
Awesome FasterCSV Features. Thanks @JEG2
# http://ruby-doc.org/stdlib-1.9.2/libdoc/csv/rdoc/CSV.html#method-c-load
# http://ruby-doc.org/stdlib-1.9.2/libdoc/csv/rdoc/CSV.html#method-c-dump
# https://github.com/JEG2/faster_csv/blob/master/test/tc_serialization.rb
require 'csv'
class Person
attr_accessor :id, :name, :email
def self.csv_load(meta, headers, row)
person = Person.new
@coreyhaines
coreyhaines / .rspec
Last active August 15, 2024 15:13
Active Record Spec Helper - Loading just active record
--colour
-I app
@tonkapark
tonkapark / bigcartel_to_shopify_csv.rb
Created August 3, 2011 18:06
Generate a products csv file to make it easier to migrate from Big Cartel to Shopify
#script created by Matt Anderson, http://tonkapark.com
require 'rubygems'
require 'bigcartel'
require 'csv'
# SET YOUR BIGCARTEL ID HERE
STORE = 'ugmonk'
# SET THE BEST NAME FOR ANY DROP DOWN OPTIONS
@kmile
kmile / xml_parser.rb
Created February 15, 2011 12:53
A small nokogiri xml reader DSL.
# A small DSL for helping parsing documents using Nokogiri::XML::Reader. The
# XML Reader is a good way to move a cursor through a (large) XML document fast,
# but is not as cumbersome as writing a full SAX document handler. Read about
# it here: http://nokogiri.org/Nokogiri/XML/Reader.html
#
# Just pass the reader in this parser and specificy the nodes that you are interested
# in in a block. You can just parse every node or only look inside certain nodes.
#
# A small example:
#