Skip to content

Instantly share code, notes, and snippets.

@yaoyi
yaoyi / app.js
Created May 23, 2013 01:37 — forked from elranu/app.js
//app.js Socket IO Test
var app = require('express').createServer(),
redis = require('socket.io/node_modules/redis'),
io = require('socket.io').listen(app);
var pub = redis.createClient(port, "url");
var sub = redis.createClient(port, "url");
var store = redis.createClient(port, "url");
pub.auth('pass', function(){console.log("adentro! pub")});
sub.auth('pass', function(){console.log("adentro! sub")});
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev
cd /tmp
wget http://ruby.taobao.org/mirrors/ruby/1.9/ruby-1.9.3-p429.tar.gz
tar -xvzf ruby-1.9.3-p429.tar.gz
cd ruby-1.9.3-p429/
./configure --prefix=/usr/local --disable-install-rdoc
make
@yaoyi
yaoyi / Gemfile
Created August 13, 2013 07:19
sinatra + mongoid 的 CRUD
source 'http://rubygems.org'
gem 'rack'
gem 'rack-flash'
gem 'thin'
gem 'sinatra', :require => 'sinatra/base'
gem 'mongoid'
gem 'bson_ext'
gem 'slim'
@yaoyi
yaoyi / Gemfile
Created September 22, 2013 02:39 — forked from HungYuHei/Gemfile
用redis实现了用户之前互相follow
# Gemfile
gem 'redis', '~> 3.0.1'
@yaoyi
yaoyi / zsh.md
Created October 16, 2013 06:42 — forked from tsabat/zsh.md
<!doctype html>
<html ng-app="Demo" ng-controller="AppController">
<head>
<meta charset="utf-8" />
<title>
Lazy Loading Images With AngularJS
</title>
<style type="text/css">
@yaoyi
yaoyi / Gemfile
Created February 7, 2014 14:30 — forked from zernel/Gemfile
gem 'devise'
gem 'omniauth'
gem 'omniauth-github'
gem "omniauth-twitter"
gem "omniauth-facebook"
gem "omniauth-google-oauth2"
@yaoyi
yaoyi / README.md
Created February 13, 2014 14:39 — forked from nicerobot/README.md

To run this, you can try:

curl -ks https://gist.github.com/nicerobot/2697848/raw/uninstall-node.sh | bash

I haven't tested this script doing it this way but i run a lot of my Gists like this so maybe this one'll work too.

Alternatively,

curl -ksO https://gist.github.com/nicerobot/2697848/raw/uninstall-node.sh

chmod +x ./uninstall-node.sh

# put this in config/initializers/carrierwave.rb
module CarrierWave
module MiniMagick
def quality(percentage)
manipulate! do |img|
img.quality(percentage)
img = yield(img) if block_given?
img
end
end