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 "restclient-cpp/connection.h" | |
#include "restclient-cpp/restclient.h" | |
#include <iostream> | |
#include <string> | |
#include <string.h> | |
#include <stdio.h> | |
#include <assert.h> | |
#include <stdexcept> |
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 requests as rq | |
import httpsig | |
import json | |
import pprint | |
KEY_DIR = '/home/fan/Downloads/att_keys' | |
cert=(KEY_DIR + '/client.crt', KEY_DIR + '/client.key') | |
def print_headers(headers): | |
print 'HEADERS: ' |
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 is based on ayeks's gist. I added a detailed parsing of Leaf 1 and Leaf 2 and higher. | |
* | |
* Fan Zhang | |
*/ | |
#include <stdio.h> | |
#include <stdint.h> | |
#define POW2(n) (1 << n) | |
#define B2MB(b) (b << 20) |
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
ColorForeground=#f2f2e5e5bcbc | |
ColorBackground=#323230302f2f | |
ColorCursor=#d65bc4cd8ca1 | |
ColorPalette=#323230302f2f;#cccc24241d1d;#989897971a1a;#d7d799992121;#454585858888;#b1b162628686;#68689d9d6a6a;#929283837474;#1d1d20202121;#fbfb49493434;#b8b8bbbb2626;#fafabdbd2f2f;#8383a5a59898;#d3d386869b9b;#8e8ec0c07c7c;#b9b9a6a69393 |
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
% geometry | |
\usepackage[letterpaper]{geometry} | |
% code listing | |
\usepackage[usenames, dvipsnames]{xcolor} | |
\usepackage{listings} | |
\lstset{language=C++, | |
basicstyle=\ttfamily, | |
keywordstyle=\color{blue}\ttfamily, | |
stringstyle=\color{red}\ttfamily, |
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
\newcommand{\fan}[1]{\textcolor{red}{[\textsf{Fan: #1}]}} |
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
lpr -P cupsprint1_coecis_cornell_edu -o sides=two-sided-long-edge report.pdf |
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
#!/bin/sh | |
PROXY_USER=user | |
PROXY_PASS=password | |
PROXY_PORT=3128 | |
# Clear the repository index caches | |
yum clean all | |
# Update the operating system |
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
# from http://stackoverflow.com/a/7427376/1616210 | |
parser = argparse.ArgumentParser(description='Description of your program') | |
parser.add_argument('-f','--foo', help='Description for foo argument', required=True) | |
parser.add_argument('-b','--bar', help='Description for bar argument', required=True) | |
args = vars(parser.parse_args()) | |
if args['foo'] == 'Hello': | |
# code here | |
if args['bar'] == 'World': |
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
ffmpeg -i input.mp4 -c:v copy -c:a mp3 output.mp4 |