Skip to content

Instantly share code, notes, and snippets.

View hlxwell's full-sized avatar
⛷️
Focusing

Michael He hlxwell

⛷️
Focusing
View GitHub Profile
#!/bin/bash
# Interactive PoPToP install script on a OpenVZ VPS
# Tested on Debian 5, 6, and Ubuntu 11.04
# 2011 v1.1
# Author: Commander Waffles
# http://www.putdispenserhere.com/pptp-debian-ubuntu-openvz-setup-script/
echo "######################################################"
echo "Interactive PoPToP Install Script for OpenVZ VPS"
echo "by Commander Waffles http://www.putdispenserhere.com"

This was tested using Ruby 2.0.0 and Rails 4.0.0.rc1.

Bower

  1. Set the install directory for Bower components:

    // .bowerrc
    {

"directory": "app/assets/components"

*.app
build/
.DS_Store
*~
.LSOverride
*.xcuserdatad
*.xcworkspace
@hlxwell
hlxwell / mysql-to-mongo
Last active October 4, 2015 14:27 — forked from shenzhaoyan/gist:824583
MySQL to MongoDB
MySQL: SELECT * FROM user WHERE name = "foobar"Mongo: db.user.find({"name" : "foobar"})
MySQL: INSERT INOT user (`name`, `age`) values ("foobar",25)
Mongo: db.user.insert({"name" : "foobar", "age" : 25})
MySQL: DELETE * FROM user
Mongo: db.user.remove({})
MySQL: DELETE FROM user WHERE age < 30
Mongo: db.user.remove({"age" : {$lt : 30}}) $gt : > ; $gte : >= ; $lt : < ; $lte : <= ; $ne : !=
MySQL: UPDATE user SET `age` = 36 WHERE `name` = "foobar"
Mongo: db.user.update({"name" : "foobar"}, {$set : {"age" : 36}})
MySQL: UPDATE user SET `age` = `age` + 3 WHERE `name` = "foobar"