Skip to content

Instantly share code, notes, and snippets.

@gccpacman
gccpacman / go_exercise.go
Last active August 29, 2015 14:13
A tour to go Exercise
/*
https://tour.golang.org/flowcontrol/8
http://go-tour-zh.appspot.com/flowcontrol/8
*/
/* Exercise: Loops and Functions #43 */
/* Exercise: Loops and Functions #43 */
package main
import (
@gccpacman
gccpacman / 0_reuse_code.js
Last active September 3, 2015 03:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@gccpacman
gccpacman / linux mint让休眠功能工作.md
Last active October 9, 2015 08:20
linux mint/ Ubuntu/ Debian

Enable the Hibernate option

To enable Hibernate, I followed this answer from Dima. After enabling hibernate you will have an option to hibernate in the indicator session menu at top panel. But, though you can hibernate you may not resume from hibernate. You will just be given a new session. The fixes are below. The fixes to be able to resume from hibernate There is two way to fix this.

  1. Editing the /etc/initramfs-tools/conf.d/resume file First get the UUID of the swap partition.

sudo blkid | grep swap

@gccpacman
gccpacman / python_date.md
Last active October 9, 2015 08:20
Python 基础

How do I calculate number of days betwen two dates using Python?

If you have two date objects, you can just subtract them.

from datetime import date

d0 = date(2008, 8, 18)
d1 = date(2008, 9, 26)
delta = d0 - d1
print delta.days
@gccpacman
gccpacman / test_mongodb.py
Created April 28, 2016 11:44
test mongo db connect
import pymongo
import datetime
client = pymongo.MongoClient("mongodb://localhost/test")
db = client.test_database
post = {
"author": "Mike",
"text": "My first blog post!",
@gccpacman
gccpacman / file
Last active May 4, 2016 14:04
freedom_public
{"0.43516015155176513":"-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nCharset: UTF-8\r\n\r\nxv8AAABSBAAAAAATCCqGSM49AwEHAgMEcpTUP4SlNFgzs/F2E3wvRUUWYIldngQ/\r\ngaph6dr/52jCagYanEKVLeYurTMV5nFBls6SXl5cEgeQ4RHxiFZIQc3/AAAACDxn\r\naXRodWI+wv8AAACNBBATCAA//wAAAAWCVw8mWv8AAAACiwn/AAAACZC8ThRTFmgd\r\nO/8AAAAFlQgJCgv/AAAAA5YBAv8AAAACmwP/AAAAAp4BAAC2ewD/YqzIoSjzioRa\r\nKCJyYS5dygVs0ApogRp3YaGc8AGyAzIBAONjEpStdftge3wCyUgAXH9oG5+t44L7\r\nyiFBs5WBbLn9zv8AAABWBAAAAAASCCqGSM49AwEHAgMEQE9Lu3kk8wpyi1zVL5Ug\r\nQQCN261Fb5dqxQRjWt5oEN+dgpgjiqpPp5+P+/2FfaJK9gvH9tF6Y7udZHZjrLbF\r\n1wMBCAfC/wAAAG0EGBMIAB//AAAABYJXDyZa/wAAAAmQvE4UUxZoHTv/AAAAApsM\r\nAABpSgD/Xt0ZCSTDoOj0GTMBB99Hr6Uz0pvmg51meyFLa/EHAp0BAKQArj2C4PwO\r\nvmxrOqbH9hLU6DIUIRu/XfQamnEZjs4N\r\n=uoZF\r\n-----END PGP PUBLIC KEY BLOCK-----\r\n","0.1714806222637062":"-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nCharset: UTF-8\r\n\r\nxv8AAABSBAAAAAATCCqGSM49AwEHAgMEcpTUP4SlNFgzs/F2E3wvRUUWYIldngQ/\r\ngaph6dr/52jCagYanEKVLeYurTMV5nFBls6SXl5cEgeQ4RHxiFZIQc3/AAAACDxn\r\naXRodWI+wv8AAACNBBATC
import os
import hash
# content hah
#what
print(‘hello gist tool’)
@gccpacman
gccpacman / clients.md
Created May 12, 2016 15:39 — forked from defunkt/clients.md
A list of Gist clients.

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support

@gccpacman
gccpacman / multiple_ssh_setting.md
Last active September 4, 2016 23:59 — forked from RichardBronosky/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@gccpacman
gccpacman / wechat_getappmsgext.py
Created April 29, 2016 14:27 — forked from chen206/wechat_getappmsgext.py
微信公众号文章抓取阅读数和点赞数
# !/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import json
from urlparse import urlparse, parse_qs
import requests