Skip to content

Instantly share code, notes, and snippets.

var Sequelize = require('sequelize')
, sequelize = new Sequelize('sequelize_test', 'root')
var Manufacturer = sequelize.define('manufacturer', {
name: Sequelize.STRING
});
var GraphicsCard = sequelize.define("graphics_card", {
model: Sequelize.STRING,
RAM: Sequelize.INTEGER
@sdepold
sdepold / LICENSE.txt
Created August 15, 2012 05:50 — forked from 140bytes/LICENSE.txt
140byt.es -- addObserverMethods
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Sascha Depold http://depold.com
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
var models = require('./models');
models.synchronize();
@sdepold
sdepold / gist:2507049
Created April 27, 2012 07:41
category migration script cc @sdepold
puts "!! unique-ifying category names"
mk_unique = lambda{ |c| c.update_attribute(:name, c.name + rand(8**16).to_s(36)); print "." }
Category.all.each{ |c| mk_unique[c] if c.name.empty? || (Category.find_all_by_name(c.name).size > 1) }; nil
puts "\n\n!! migrating gettext keys"
mk_migrate = lambda{ |c, gk| gk.update_attribute(:accesskey, "category.#{c.name.to_slug}"); print "." }
Category.all.each{ |c| (gk = GettextKey.find_by_accesskey("category.#{c.id}")) ? mk_migrate[c, gk] : print("X") }; nil
@sdepold
sdepold / Readme.md
Created September 12, 2011 05:44 — forked from grosser/Readme.md
Most recommended games on Steam

Get the most recommended games from steam (because steam does not tell...) this is an example and no invitation to DDos steam ;)