Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am op01 on github.
  • I am op01 (https://keybase.io/op01) on keybase.
  • I have a public key whose fingerprint is A92C B42C 644F FE0E 5935 7D10 F921 6A87 425E 8C6D

To claim this, I am signing this object:

// ==UserScript==
// @name Reg Chula
// @namespace sssss
// @description wtf
// @include https://www2.reg.chula.ac.th/cu/reg/logon/logonframe.html
// @version 1
// @grant none
// ==/UserScript==
document.body.onload = function() {
document.getElementsByTagName('frame')[2].contentDocument.getElementsByName('code')[0].parentNode.innerHTML += "<button id='autoCap'>AUTO CAPTCHA !!!</button>";
@op01
op01 / adm59.py
Created May 30, 2016 14:10
admission 59 utils
import requests,threading,time,sys,re
MAX = 9200000
MIN = 9000000
N=10
threads = [None] * N
results = [None] * N
def post(reg,idcard):
try:
@op01
op01 / adm58.py
Last active August 29, 2015 14:21
admission 58 regno finder
import requests,threading,time,sys
idnum = sys.argv[1]
MAX = 8200000
N=10
threads = [None] * N
results = [None] * N
def post(reg,idcard):
try:
result=requests.post('http://admission.cuas.or.th/adm58/findpdf_result.php',{'regno':str(reg),'pplid':str(idcard),'submit':'ค้รหาใบสมัคร'})
except requests.exceptions.ConnectionError:
@op01
op01 / websocket-server.py
Created May 6, 2015 10:52
simple echo websocket server implement in python
import socket,select,time,re,base64,hashlib
def debug(b):
print("txt:")
print(b)
# print(b.decode('UTF-8'),end='')
print("ENDtxt")
def getAll(cs):
ret = bytes()
while len(select.select([cs],[],[],0)[0]):
recv=cs.recv(10)

SQL Cheat Sheet

CRUD

  1. Create
  • insert (all colunms)
insert into T values(V1,V2,V3)
@op01
op01 / monkey.py
Created May 13, 2014 16:10
TOI10th day1 monkey
class Bar:
def __init__(self,s):
p,h = s.split(' ')
self.p = int(p)
self.h = int(h)
n,m,k = (int(i) for i in input().split(' '))
b = [int(i) for i in input().split(' ')[0:m]]
bars = [Bar(input()) for i in range(k)]
st = int(input())
st-=1
#include<cstdio>
#include<queue>
using namespace std;
struct container
{
int a;
int b;
};
bool operator<(container a,container b)
{
sub getContent
{
open FH,shift;
$content = '';
$content.=$_ while(<FH>);
return $content;
}
sub sar
{
$txt = shift;
#include<iostream>
#include<cstdlib>
#include<ctime>
#include<cmath>
#include<unistd.h>
#include<cstdio>
#include<sstream>
#include<string.h>
using namespace std;