Skip to content

Instantly share code, notes, and snippets.

View revskill10's full-sized avatar
🎯
Focusing

Truong Hoang Dung revskill10

🎯
Focusing
  • Freelancer
  • Haiphong, Vietnam
View GitHub Profile
testnodefdsfds
testnodefdsfds
#!/bin/sh
#Example for unix like systems
# NOTE: Erlang must be already installed
# Download:
wget http://www.rabbitmq.com/releases/rabbitmq-server/v1.7.2/rabbitmq-server-generic-unix-1.7.2.tar.gz
# Untar:
tar -xzvf rabbitmq-server-generic-unix-1.7.2.tar.gz
@revskill10
revskill10 / index.html
Created September 24, 2012 22:59 — forked from adunkman/index.html
Relay messages from RabbitMQ to a browser using Socket.io
<!DOCTYPE html>
<html>
<head>
<script src="/socket.io/socket.io.js"></script>
<script>
(function () {
var onMessage = function (data) {
// Do something with the message data
};
@revskill10
revskill10 / app.coffee
Created October 9, 2012 23:50 — forked from jondot/app.coffee
image-gallery
class Thumb extends Backbone.Model
defaults:
uri: ''
state: ''
select: (state) ->
st = ''
st = 'selected' if state
@set('state' : st)
@revskill10
revskill10 / loglive
Created October 15, 2012 08:19 — forked from ydbondt/loglive
Log live for Git
#!/bin/bash
watch --color "git --no-pager log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all -20"
@revskill10
revskill10 / usevm.md
Created October 18, 2012 08:10 — forked from fideloper/usevm.md
You should develop in a Virtual Machine

#You should do all your LAMP development in a Virtual Machine

##Here's Why:

Many of us develop on Macintoshes. There are many reasons for this, but one of them is that it's based on a Unix platform of some sort. This allows us to run common server software such as Apache, Ruby, Python and Nodejs on our Macs.

Our computers become powerful develoment machines similar to the servers our apps will eventually live on.

Sometime we start our computer only to find Apache won't start, or MySQL can't create a PID file, or we've updated to Mountain Lion and Apache needs to be reconfigured. Death!

@revskill10
revskill10 / gist:3936462
Created October 23, 2012 03:27 — forked from Cosmo/gist:2489482
pdf to jpg
def convert_to_previews(new_file)
name = File.basename(current_path)
images = Magick::Image.read(current_path) do
self.background_color = "white" # does not work for me :/
end
if images.length > 0
save_path = "#{Rails.root}/public/uploads/#{model.class.to_s.underscore}/file/#{model.id}/slides"
@revskill10
revskill10 / pdf2jpg.sh
Created October 23, 2012 03:27 — forked from yura/pdf2jpg.sh
script to PDF to JPG using pdftk and imagemagick
#!/bin/bash
# Script to convert PDF file to JPG images
#
# Dependencies:
# * pdftk
# * imagemagick
PDF=$1