This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'yaml' | |
DB_ADAPTER = "postgresql" | |
DATABASE = "my_database" | |
ENCODING = 'utf8' | |
TEMPLATE = 'template0' | |
TIMEOUT = 5000 | |
POOL = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Vietjet Air Crawlee</title> | |
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js'></script> | |
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap-combined.min.css" rel="stylesheet"> | |
</head> | |
<body> | |
<script> | |
window.onload = function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# require lame http://lame.sourceforge.net | |
import sys | |
import os | |
import re | |
import subprocess | |
path = sys.argv[1:][0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This will format python datetime as a string to be used within jinja conditionals for comparing current date to article date using pelican app. | |
1. Create a file named jinjaext.py | |
2. paste the following snippet | |
def convertdate(datetime, format='%a-%d-%m-%Y'): | |
return datetime.date().strftime(format) | |
3. Add the following line to your config file |
I hereby claim:
- I am quangquach on github.
- I am quangquach (https://keybase.io/quangquach) on keybase.
- I have a public key whose fingerprint is B1A4 BED0 393A 3556 38D0 15EC 2A7C 169F 75D5 E5A2
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn mark [xs idx] | |
"Iterate over the xs with each j step of (idx * idx + (j * idx)) | |
For each element of step, mark them false (a.k.a not a prime number)" | |
(loop [arr xs | |
j 0] | |
(let [step (+ (* idx idx ) (* j idx))] | |
(if (< step (count arr)) | |
(recur (assoc arr step false) (inc j)) | |
arr)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <sys/stat.h> | |
#include <OpenCL/OpenCL.h> | |
#define ARRAY_SIZE 1024 | |
cl_context CreateContext() | |
{ | |
cl_int errNum = 0; | |
cl_uint numPlatforms = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gem install bson | |
# gem install bson_ext | |
# gem install yajl-ruby | |
# gem install json | |
# gem install msgpack | |
# gem install oj | |
require 'rubygems' | |
require 'benchmark' | |
require 'yaml' |