Skip to content

Instantly share code, notes, and snippets.

View timchunght's full-sized avatar

Timothy Chung timchunght

View GitHub Profile
@timchunght
timchunght / aes-server.go
Created January 19, 2022 18:41 — forked from thinkclay/server.go
Basic Encryption and Decryption with a Golang Web Server Application
package main
import (
"crypto/aes"
"crypto/cipher"
"encoding/base64"
"fmt"
"io/ioutil"
"log"
"net/http"
@timchunght
timchunght / client.js
Created April 29, 2020 20:54 — forked from redism/client.js
Simple socket.io server performance test
/**
* A simple socket.io client for performance benchmark
*
* Created by redism on 2014. 4. 22..
*/
var SocketIO = require('socket.io-client'),
argv = require('optimist').argv;
var n = argv.n || 10;
@timchunght
timchunght / gist:950a122177654ab0768c5a3a175ffeff
Created April 20, 2017 06:25 — forked from nl5887/gist:f88ca64b67f7dce3690c
Dynamically returns a zip file consisting of multiple Amazon S3 objects
// download zipfile
func ZipHandler(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
token := vars["token"]
db, err := sql.Open("mysql", config.DSN)
if err != nil {
panic(err.Error()) // Just for example purpose. You should use proper error handling instead of panic
}
@timchunght
timchunght / gist:c257b71b82603d04c6e78a352226b77a
Created April 20, 2017 06:25 — forked from nl5887/gist:f88ca64b67f7dce3690c
Dynamically returns a zip file consisting of multiple Amazon S3 objects
// download zipfile
func ZipHandler(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
token := vars["token"]
db, err := sql.Open("mysql", config.DSN)
if err != nil {
panic(err.Error()) // Just for example purpose. You should use proper error handling instead of panic
}
<?xml version='1.0' encoding='UTF-8'?>
<hudson.tasks.Shell_-DescriptorImpl>
<shell>/tmp/jenkins/citman_shell_wrapper</shell>
</hudson.tasks.Shell_-DescriptorImpl>
class WebkitToPng
def self.create(urls, options={})
urls.each do |url|
puts "convert #{url} to #{options[:dir]}"
url.sub!('//', "//#{options[:auth]}@") if options[:auth]
op = "-F -D #{options[:dir]} -o #{url.split('/').last}"
op += " --user-agent='#{user_agent}'" if options[:mobile]
exec(url, op)
end
@timchunght
timchunght / .gitignore
Last active October 22, 2015 06:48 — forked from ryoco/.gitignore
pdf to image with Go
/*.swp
/*.pdf
/*.png
.DS_Store
@timchunght
timchunght / static-site-nginx-setting
Created October 17, 2015 06:32
static-site-nginx-setting
server {
listen 80;
server_name localhost;
rewrite_log on;
location / {
autoindex on;
alias /var/www/blsite/;
}
@timchunght
timchunght / Vagrantfile
Created September 25, 2015 20:35 — forked from dommmel/Vagrantfile
Vagrantfile for Ruby on Rails application development (rbenv, postgres, node.js)
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
set -e
set -x
cd
sudo apt-get update -y
sudo apt-get install \

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev