Skip to content

Instantly share code, notes, and snippets.

View yinhm's full-sized avatar
🎯
Focusing

yinhm yinhm

🎯
Focusing
View GitHub Profile
@yinhm
yinhm / auth.go
Created April 1, 2015 03:37
gin middleware for login via Google OAuth 2.0
// Copyright 2014 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@yinhm
yinhm / media.go
Created March 19, 2015 08:01
mandible media server naive testcase
package media
import (
"bytes"
"encoding/json"
"io/ioutil"
"net/http"
"net/url"
)
@yinhm
yinhm / zipline_adapter.py
Created November 16, 2012 06:06 — forked from fawce/csvds.py
Rough draft, datafeed adapater for zipline
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012 fawce@zipline
# Copyright 2012 yinhm
"""
Generator-style datafeed adapater for zipline.
Based on https://gist.github.com/4057021
"""
@yinhm
yinhm / gist:3096525
Created July 12, 2012 07:50
pptpd for Debian
# Automaticlly install pptpd on Debian Linux
#
# Ripped from http://blog.diahosting.com/linux-tutorial/pptpd/
# pptpd source rpm packing by it's authors
#
# Authors: yinhm
# Version: 0.1.0
# URL: http://yinhm.appspot.com/
@yinhm
yinhm / pptpd.sh
Created November 7, 2010 17:02
Automaticlly install pptpd on Amazon EC2 Amazon Linux
# Automaticlly install pptpd on Amazon EC2 Amazon Linux
#
# Ripped from http://blog.diahosting.com/linux-tutorial/pptpd/
# pptpd source rpm packing by it's authors
#
# WARNING:
# first ms-dns setting to 172.16.0.23, 172.16.0.23 was showing on my
# /etc/resolv.conf, I'm not sure this is the same on all Amazon AWS zones.
#
# You need to adjust your "Security Groups" which you are using too.
Processing SessionsController#destroy (for 127.0.0.1 at 2009-11-10 09:56:06) [GET]
User Columns (1.0ms) SHOW FIELDS FROM `users`
User Load (0.3ms) SELECT * FROM `users` WHERE (`users`.`id` = 1) AND (state = 'active')
SQL (0.1ms) BEGIN
User Update (43.5ms) UPDATE `users` SET `updated_at` = '2009-11-10 09:56:06', `remember_token_expires_at` = NULL, `remember_token` = NULL WHERE `id` = 1
[paperclip] Saving attachments.
SQL (78.4ms) COMMIT
Redirected to http://localhost:3000/
Completed in 146ms (DB: 123) | 302 Found [http://localhost/logout]
/!\ FAILSAFE /!\ Tue Nov 10 09:56:06 +0800 2009