Skip to content

Instantly share code, notes, and snippets.

View pcchou's full-sized avatar

Ping-yu Chou pcchou

View GitHub Profile
@pcchou
pcchou / GravatarHash
Last active August 29, 2015 14:04
Python Script to grab Gravatar image.
# Released under MIT License
import sys
import hashlib
m = hashlib.md5()
processed = sys.argv[1].strip()
m.update(processed.encode('utf-8'))
print("Email: " + processed)
hashout = m.hexdigest()
@pcchou
pcchou / gqs.sh
Last active August 29, 2015 14:10
gqs
#!/bin/bash
#BJ4
# Released under MIT License
UA="Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
BAHAID="pcchou"
BAHARUNE="f8ddec235d436c59e646216551346b643ede9fb70ce30dffc1978d1adeb5821aaaa0df392444a5a59f87c"
for i in {1..56212};do
echo $i
@pcchou
pcchou / index.js
Last active August 29, 2015 14:10 — forked from edokeh/index.js
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
@pcchou
pcchou / ysitdboard.ino
Last active August 29, 2015 14:12
#ysitd LED Board
// Released with MIT License
const byte basePin = PB0;
const byte modePin = PB1;
const byte brightPin = PB2;
const byte loadPin = PB3;
byte mode = 0; // 0 == off; 1 == on; 2 == blink 0.5s; 3 == blink 1s;
byte brightness = 202; // 255, 202, 149, 43
boolean modeButtonRead = false;
@pcchou
pcchou / a.py
Created February 4, 2015 06:52
#!/usr/bin/env python2
# MIT License
# by pcchou http://pcchou.me/
import re
import sys
sea = re.compile(r'^(.*)pages:\[(.*)\](.*)$')
dog = re.compile(r'([^",]+")')
pg = sea.match(sys.argv[1])
### Keybase proof
I hereby claim:
* I am pcchou on github.
* I am pcchou (https://keybase.io/pcchou) on keybase.
* I have a public key whose fingerprint is 159A 96D2 A55E 765C 340F C7D9 A2B0 2770 6EC6 4BAA
To claim this, I am signing this object:

Bigger is Better (500)

Problem

The larger the primes, the stronger the RSA cryptosystem is, right?

Data.

Hint

@pcchou
pcchou / mc status
Created November 11, 2013 11:29 — forked from mmis1000/mc status
<?php
/**
* Minecraft server status fallback class
* Read the simple server info wich are actually for minecraft clients
* @author Patrick K. - http://www.silexboard.org/ - https://github.com/NoxNebula
* @license GNU Public Licence - Version 3
* @copyright c 2011-2013 Patrick K.
*/
/**
@pcchou
pcchou / b837.c
Last active September 15, 2016 06:51
#include <stdio.h>
int main() {
int times, i, j, temp, min, max;
int l = 0;
int fibonacci[1024] = {0,1};
int fibn_max_index = 1;
scanf("%d", &times);
for (i = 0; i < times; i++) {
@pcchou
pcchou / b858.cpp
Last active September 17, 2016 19:45
#include<stdio.h>
#include<set>
#define ceil_half(x) (int)((x / 2.0) + 0.5)
using namespace std;
int main() {
int no_case, n, t, sum;
int i;
set<int> sums, temp;