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
CREATE TABLE IF NOT EXISTS cards ( | |
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, | |
entry TEXT NOT NULL, | |
created_at TIMESTAMP DEFAULT (strftime('%s', 'now')) NOT NULL, | |
updated_at TIMESTAMP DEFAULT (strftime('%s', 'now')) NOT NULL | |
); | |
CREATE VIRTUAL TABLE IF NOT EXISTS cards_fts USING fts5( | |
entry, | |
content='cards', |
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
package main | |
import ( | |
"crypto/ed25519" | |
"crypto/rand" | |
"encoding/base64" | |
"fmt" | |
) | |
func main() { |
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
#change capslock to ctrl though gnome-tweak-tool | |
#set manjaro mirros | |
sudo pacman-mirrors -i -c China -m rank #choose the sources that you want | |
sudo pacman -Syy | |
#set http over socks5 in shell | |
export http_proxy=socks5://127.0.0.1:1080 https_proxy=socks5://127.0.0.1:1080 | |
#set git socks5 |
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 <limits.h> | |
#include <stdlib.h> | |
void printIEEE754(size_t const size, void const * const ptr){ | |
unsigned char *b = (unsigned char*) ptr; | |
unsigned char byte; | |
int i, j, c=0; | |
if(size == 4){ |
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
Count By 2017-07-04 | |
Repo Stars | |
https://github.com/kubernetes/kubernetes 24538 | |
https://github.com/bayandin/awesome-awesomeness 19182 | |
https://github.com/astaxie/build-web-application-with-golang 16645 | |
https://github.com/coreos/etcd 13933 | |
https://github.com/mholt/caddy 12840 | |
https://github.com/astaxie/beego 11438 | |
https://github.com/influxdb/influxdb 10952 | |
https://github.com/github/hub 10903 |
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
package main | |
import ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
func main() { | |
c := make(chan struct{}) |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"path" | |
"text/template" | |
"github.com/jmoiron/sqlx" | |
_ "github.com/lib/pq" |
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
MINUTE = 60 | |
HOUR = MINUTE*60 | |
DAY = HOUR*24 | |
WEEK = DAY*7 | |
MONTH = DAY*30 | |
YEAR = MONTH*12 | |
def time_ago_in_words(near_time, far_time) | |
diff = near_time.to_i - far_time.to_i |
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
import os, sys; | |
import distutils.file_util as file_util | |
def iterate_path(source): | |
#list all files | |
files = os.listdir(source) | |
for f in files: | |
if(os.path.isfile(os.path.join(source,f))): | |
#check hide file | |
if(f[0] == "." or f == 'tmp.py'): |