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
@revskill10
revskill10 / Todo.txt
Created November 10, 2012 09:01
Thinking about work
- Data and Algorithms - quants and scientists
- Infrastructure - Backend systems that drive Uber
- Apps - iPhone, Android, SMS, Web, the works
- Tools - Internal tools, partner and customer support workflow
- Analytics - help the company make better decisions through the magic of numbers
@revskill10
revskill10 / install-java-ubuntu-12.10.txt
Created November 12, 2012 03:16
Install JDK 6 for Ubuntu 12.10
1. Go to this url to download package
http://www.oracle.com/technetwork/java/javase/downloads/jdk6u37-downloads-1859587.html
2. Follow this instructtion:
http://www.printandweb.ca/2012/10/manually-install-oracle-jdk-6-for.html
@revskill10
revskill10 / GetNamePublisher.vb
Created November 16, 2012 07:12
Get Publisher and Year from Dspace excel
Sub testFirst()
Set ws = ActiveSheet
Dim Tmp, Tmp2, Index As Integer
Dim Sentence, Result, Result2 As String
For Index = 1 To 33
Sentence = Cells(Index, 11).Value
Tmp = InStr(Sentence, ",")
If Tmp > 0 Then
Result = Left(Sentence, Tmp - 1)
@revskill10
revskill10 / utilities.sh
Created November 24, 2012 03:41
Ubuntu utilities
for i in `awk -F " " '{print $i}' ~/dspace/import/800.m`; do rm -rf ~/dspace/import/800/$i; done
#One-liner to lowercase all filenames in the current directory (bash flavor):
for f in *; do mv $f `echo $f | tr '[:upper:]' '[:lower:]'`; done
@revskill10
revskill10 / solrquery.sh
Created December 11, 2012 08:14
Query item and time of a download from a student
$ curl -XGET "http://lib.hpu.edu.vn/solr/statistics/select?indent=on&wt=json&q=
bundleName:ORIGINAL%20AND%20epersonid:1&fl=referrer,time&sort=time%20desc" > do
wnload.json

Installation commands:

$ wget http://redis.googlecode.com/files/redis-2.2.2.tar.gz
$ tar xvfz redis-2.2.2.tar.gz 
$ cd redis-2.2.2/
$ mkdir -p /opt/redis
$ make PREFIX=/opt/redis install
$ cp redis.conf /opt/redis/redis.conf
$ chown -R redis:redis /opt/redis
zipstream = require "zipstream"
fs = require "fs"
async = require "async"
class StreamingResponse
filename: ""
files: []
streaming: true
###
var Vertebrate = {};
Vertebrate.Model = Backbone.Model.extend();
Vertebrate.Collection = Backbone.Collection.extend({
model: Vertebrate.Model
});
// Source: http://en.wikipedia.org/wiki/Vertebrates
var vertebrates = new Vertebrate.Collection([
class Thumb extends Backbone.Model
defaults:
uri: ''
state: ''
select: (state) ->
st = ''
st = 'selected' if state
@set('state' : st)
#!/usr/bin/env ruby
# Libraries:::::::::::::::::::::::::::::::::::::::::::::::::::::::
require 'rubygems'
require 'sinatra/base'
require 'slim'
require 'sass'
require 'coffee-script'
# Application:::::::::::::::::::::::::::::::::::::::::::::::::::