Skip to content

Instantly share code, notes, and snippets.

@anhhh11
anhhh11 / gist:6933688
Created October 11, 2013 12:14
compress website before uploading to server
tar cvf - website/ | gzip -9 - >~/website.tar.gz
@anhhh11
anhhh11 / remove all .gz file
Created December 1, 2013 04:25
remove all .gz file
sudo find . -type f -name '*.gz' | xargs rm
#go to bash
soffice.exe --headless --convert-to pdf *.ppt
gs -sDEVICE=tiffgray -dNOPAUSE -r300 -sOutputFile="o-%04d.tiff" ./ttnt.pdf -c quit
for i in *.tif ; do tesseract $i $i -l vie -psm 1 ; done
mkdir done
for i in *.tiff;do if [ -f $i.txt ];then mv $i.txt done/;mv $i done/;fi;done
gs -sDEVICE=jpeg -dJPEGQ=100 -dNOPAUSE -r300 -sOutputFile="o-%04d.jpeg" ./ttnt.pdf -q -c quit
for i in done/*.txt; do j="`basename -s .tiff.txt $i`.jpeg";if [ -f $j ];then rm -f $j;fi; done
for i in *.jpeg ; do tesseract $i $i -l vie; done
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-git2.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div id="box">Hello</div>
<script id="jsbin-javascript">
var Pen = function(position){
this.position = position;
}
Pen.prototype.move = function(toPostition){
this.position = position
}
Pen.prototype.select = function(select){
this.select = select;
}
Pen.prototype.toJSON = function(){
@anhhh11
anhhh11 / README.md
Created February 15, 2016 15:27 — forked from zaim/README.md
Thunkify Rethinkdb

rethunkdb

Thunkify rethinkdb

To be used with co and/or koa.

So that we can do something like:

var r = require('rethunkdb') // not a typo, might use other name if too close :)
# From https://scotch.io/bar-talk/best-of-atom-features-plugins-acting-like-sublime-text
apm install simple-drag-drop-text git-plus tortoise-svn vim-mode merge-conflicts color-picker emmet docblockr pigments linter autocomplete-modules auto-update-packages file-icons minimap project-manager
apm install browser-plus terminal-plus git-time-machine expand-selection-to-quotes grammar-token-limit swackets recent-files-fuzzy-finder tree-view-git-status
apm install react tortoise-svn atom-beautify autoclose-html
apm list --installed --bare > package-list.txt
apm install --packages-file package-list.txt
@anhhh11
anhhh11 / test-simple-http-data.js
Created August 9, 2016 07:33 — forked from murvinlai/test-simple-http-data.js
Socket Hang up problem - A sample to generate the problem.
/*
* This is a simple HTTP data generator for testing.
*
*/
var http = require('http');
var counter = 0;
http.createServer(function (req, res) {
var start = new Date();
@anhhh11
anhhh11 / tmux-cheatsheet.markdown
Created January 24, 2018 16:17 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname