Skip to content

Instantly share code, notes, and snippets.

@zhengwy888
zhengwy888 / nginx-conf
Created November 5, 2015 02:47 — forked from beeftornado/nginx-conf
Nginx reverse proxy for Sentry (github.com/getsentry/sentry). I removed some personal information and replaced it with <UPPERCASE> so look closely. Some key information in the sentry settings - SENTRY_URL_PREFIX, FORCE_SCRIPT_NAME, and ALLOWED_HOSTS. The rest of that is pretty standard.
server {
listen 80; ## listen for ipv4; this line is default and implied
listen [::]:80 default ipv6only=on; ## listen for ipv6
root /usr/share/nginx/www;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name _;
@zhengwy888
zhengwy888 / termui_finance.go
Created April 20, 2015 02:56
To use run: > go run <script_name> <stock symbol> and it will display Price and Volume graph from the past year in your terminal
// +build ignore
// Author: Weiyi Zheng, 2015
/* learning termui and go language
To use run: > go run <script_name> <stock symbol>
and it will display Price and Volume info from last year in your terminal
things are lacking:
- two graphs can't be scaled to the same width
- no control over axis label
- be cautious running any termui stuff in chromebook's Secure Shell, it will freeze
@zhengwy888
zhengwy888 / proc_unknown.tcl
Created March 22, 2015 05:46
Tclsh 8.6 unknown proc implementation
# generated from [info body unknown] in tclsh8.6, on Debian (Jessie)
# man page http://www.tcl.tk/man/tcl8.5/TclCmd/unknown.htm
variable ::tcl::UnknownPending
global auto_noexec auto_noload env tcl_interactive errorInfo errorCode
if {[info exists errorInfo]} {
set savedErrorInfo $errorInfo
}
if {[info exists errorCode]} {
<?php
class ReconnectingPDO
{
protected $dsn, $username, $password, $pdo, $driver_options;
public function __construct($dsn, $username = "", $password = "", $driver_options = array())
{
$this->dsn = $dsn;
$this->username = $username;
$this->password = $password;