Skip to content

Instantly share code, notes, and snippets.

Avatar

Chih-Hsuan Yen yan12125

View GitHub Profile
@yan12125
yan12125 / gist:1399c9103354c2614351
Created Mar 6, 2015
Send a comment request to facebook with tagging
View gist:1399c9103354c2614351
curl -v 'https://www.facebook.com/ajax/ufi/add_comment.php' -H 'Cookie: c_user=[my_uid]; xs=[xs]' --data 'ft_ent_identifier=[object_id]&comment_text=[coment text]&client_id=1:1[any number:any number]&fb_dtsg=[fb_dtsg]'
object_id: https://www.facebook.com/[username]/posts/[object_id]
@yan12125
yan12125 / aagGen.cpp
Created Dec 31, 2012
AAG Circuit file generator version 2
View aagGen.cpp
#include <iostream>
#include <ctime>
#include <cstdlib>
#include <vector>
#include <sstream>
#include <fstream>
#include <cstring>
using namespace std;
enum GateType { PI, AIG, UNDEF };
@yan12125
yan12125 / build.cmd
Last active Dec 11, 2015
Win32 Assembly example
View build.cmd
ml /c winapi.asm
link winapi.asm /subsystem:console
View Makefile
COMMON_OBJECTS=sparse_crc32.o \
backed_block.o \
output_file.o \
sparse.o \
sparse_err.o \
sparse_read.o \
stringprintf.o
TARGETS=simg2img \
append2simg \
@yan12125
yan12125 / flame.md
Created Jun 3, 2017
Firefox OS resources
View flame.md
@yan12125
yan12125 / main.js
Created Jul 10, 2017
TOTP with Node.js
View main.js
'use strict';
var notp = require('notp'),
thirty_two = require('thirty-two');
var stdin = process.openStdin();
console.log("Entery TOTP key:");
stdin.addListener("data", function(d) {
var key = d.toString().trim().replace(/ /g, '');
View mir-bzr.diff
=== modified file 'cmake/FindGtestGmock.cmake'
--- cmake/FindGtestGmock.cmake 2017-09-07 05:58:13 +0000
+++ cmake/FindGtestGmock.cmake 2017-09-19 13:22:05 +0000
@@ -20,14 +20,6 @@
HINTS ${GTEST_INSTALL_DIR}
)
-#gmock
-find_path(
- GMOCK_INSTALL_DIR CMakeLists.txt
@yan12125
yan12125 / keybase.md
Created Nov 9, 2017
Keybase Github prove
View keybase.md

Keybase proof

I hereby claim:

  • I am yan12125 on github.
  • I am yan12125 (https://keybase.io/yan12125) on keybase.
  • I have a public key ASBLlQS7pyXvBRR5OrHovA_RrouOJGt4-8aUnNvGNwo0Iwo

To claim this, I am signing this object:

@yan12125
yan12125 / dependency.py
Last active Feb 23, 2018
Print the dependencies of Windows EXE/DLL using winedump (deprecated; check https://github.com/xantares/mingw-ldd instead)
View dependency.py
#!/usr/bin/env python3
# WTFPL – Do What the Fuck You Want to Public License
import subprocess
import os
import sys
prefixes = {
'i386': '/usr/i686-w64-mingw32/bin',
'AMD64': '/usr/x86_64-w64-mingw32/bin'
}
@yan12125
yan12125 / hornet-1.0.patch
Last active May 13, 2018
Build instruction and patch file for hornet-1.0
View hornet-1.0.patch
diff -ur hornet-1.0/src/boost.task-0.4.2/boost/task/detail/bind_processor.hpp hornet-1.0-mod2/src/boost.task-0.4.2/boost/task/detail/bind_processor.hpp
--- hornet-1.0/src/boost.task-0.4.2/boost/task/detail/bind_processor.hpp 2011-06-01 21:51:37.000000000 +0800
+++ hornet-1.0-mod2/src/boost.task-0.4.2/boost/task/detail/bind_processor.hpp 2014-05-04 02:58:12.144146742 +0800
@@ -7,7 +7,7 @@
#ifndef BOOST_TASKS_DETAIL_BIND_PROCESSOR_H
#define BOOST_TASKS_DETAIL_BIND_PROCESSOR_H
-#include <boost/task/detail/config.hpp>
+//#include <boost/task/detail/config.hpp>
You can’t perform that action at this time.