Skip to content

Instantly share code, notes, and snippets.

View yaodong's full-sized avatar

Yaodong Zhao yaodong

View GitHub Profile
@yaodong
yaodong / qingcloud.css
Created January 1, 2016 17:12
qingcloud.css
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section,summary
{
display: block;
}
audio,canvas,video
{
display: inline-block;
}
audio:not([controls])
{
@yaodong
yaodong / pinboard_schema.sql
Created January 6, 2016 05:17
pinboard.in schema
-- MySQL dump 10.13
--
-- Pinboard database schema
-- Feel free to use this however you like. Send questions to [email protected].
-- For best results, use the Percona version of MySQL! http://www.percona.com/software/percona-server/
CREATE TABLE `bookmarks` (
`id` int(11) NOT NULL,
`url` mediumtext, -- verbatim URL (may differ from actual URL referenced by url_id)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# WELCOME TO SQUID 3.1.20
# ----------------------------
#
# This is the documentation for the Squid configuration file.
# This documentation can also be found online at:
# http://www.squid-cache.org/Doc/config/
#
# You may wish to look at the Squid home page and wiki for the
# FAQ and other documentation:
# http://www.squid-cache.org/
.label-dot {
display: inline-block;
width: 14px;
height: 14px;
border-radius: 7px;
border: 1px solid transparent;
&._none {
background: transparent;
border-color: #bbb;
acl SSL_ports port 443
acl Safe_ports port 80
acl Safe_ports port 21
acl Safe_ports port 443
acl Safe_ports port 70
acl Safe_ports port 210
acl Safe_ports port 1025-65535
acl Safe_ports port 280
acl Safe_ports port 488
acl Safe_ports port 591
@yaodong
yaodong / gist:f5b785c5b17337ce1b9a
Created February 11, 2016 23:15
things cloud requests
login
curl -H "Host: cloud.culturedcode.com" -H "Content-Type: application/json; charset=UTF-8" -H "Proxy-Connection: keep-alive" -H "Accept: */*" -H "User-Agent: ThingsMac/20803501mas (x86_64; OS X 10.11.3; en_US)" -H "Authorization: Password pppppwwwwdddd" -H "Accept-Language: en-us" --compressed https://cloud.culturedcode.com/version/1/account/user%40exmaple.com
get key
curl -H "Host: cloud.culturedcode.com" -H "Content-Type: application/json; charset=UTF-8" -H "Proxy-Connection: keep-alive" -H "Accept: */*" -H "User-Agent: ThingsMac/20803501mas (x86_64; OS X 10.11.3; en_US)" -H "Authorization: Password pppppwwwwdddd" -H "Accept-Language: en-us" --compressed https://cloud.culturedcode.com/version/1/account/user%40exmaple.com/own-history-keys
get index
curl -H "Host: cloud.culturedcode.com" -H "Content-Type: application/json; charset=UTF-8" -H "Proxy-Connection: keep-alive" -H "Accept: */*" -H "User-Agent: ThingsMac/20803501mas (x86_64; OS X 10.11.3; en_US)" -H "Accept-Language: en-us" --compressed https:
@yaodong
yaodong / conflict.json
Last active February 12, 2016 04:37
things data
{
"items": [{
"91B4717C-D8F7-427E-9A7D-9E9D3D9989E8": {
"p": {
"md": 1455251561.220994,
"tt": "testing012 -- testing 0121212"
},
"e": "Task2",
"t": 1
}
sudo apt-get update && apt-get install vim wget build-essential -y
sudo apt-get install guile-2.0 guile-2.0-dev hdf5-* -y
export LDFLAGS="-L/usr/local/lib -lm"
export CPPFLAGS="-I/usr/local/include"
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
export PATH=/lib64/mpich/bin:$PATH
cd ~ && wget http://www.fftw.org/fftw-3.3.4.tar.gz && tar -zxf fftw-3.3.4.tar.gz
cd ~/fftw-3.3.4 && ./configure && make && sudo make install
@yaodong
yaodong / github_flask_oauth2.py
Last active June 3, 2016 18:49 — forked from ib-lundgren/github_flask_oauth2.py
Example of how to use Flask with requests-oauthlib to fetch a GitHub user profile using an OAuth 2 token.
from requests_oauthlib import OAuth2Session
from flask import Flask, request, redirect, session, url_for
from flask.json import jsonify
import os
app = Flask(__name__)
# This information is obtained upon registration of a new GitHub
client_id = "<your client key>"