Skip to content

Instantly share code, notes, and snippets.

View sfc9982's full-sized avatar

Jackson Chen sfc9982

View GitHub Profile
@justgord
justgord / scoped_timer.cpp
Created January 8, 2013 09:26
C++11 scoped timer class and usage
// C++11 scoped timer class and usage
//
// an example of RAII 'resource acquisition is initialisation' idiom
// build : g++ -Wall -std=c++11 -O5 -o scoped_timer scoped_timer.cpp
//
// on linux x64 resolution of timer seems to be microseconds [ on win/VC it may be much worse ]
//
// I like this approach as it doesnt litter your existing code with garbage,
// although there might be some inaccuracy due to stack setup/pulldown of the timer class itself
//
@kendellfab
kendellfab / goto-sublime
Created August 1, 2013 20:53
Add mouse click `goto definition` in sublime text 3.
Linux - create "Default (Linux).sublime-mousemap" in ~/.config/sublime-text-3/Packages/User
Mac - create "Default (OSX).sublime-mousemap" in ~/Library/Application Support/Sublime Text 3/Packages/User
Win - create "Default (Windows).sublime-mousemap" in %appdata%\Sublime Text 3\Packages\User
[
{
"button": "button1",
"count": 1,
"modifiers": ["ctrl"],
"press_command": "drag_select",
@kevinzhow
kevinzhow / route.sh
Last active October 2, 2022 08:01
AnyConnect 路由表
route = 8.0.0.0/255.0.0.0
route = 58.0.0.0/255.0.0.0
route = 23.0.0.0/255.0.0.0
route = 117.0.0.0/255.0.0.0
route = 199.0.0.0/255.0.0.0
route = 190.0.0.0/255.0.0.0
route = 198.0.0.0/255.0.0.0
route = 173.0.0.0/255.0.0.0
route = 174.0.0.0/255.0.0.0
route = 168.0.0.0/255.0.0.0
@kevinzhow
kevinzhow / ip_cook.rb
Created March 20, 2014 11:24
路由转换
#utf-8
require 'netaddr'
newfile = File.open("some_file", "w")
File.foreach('out_ip').with_index { |line, line_num|
line = line.split(',')[0].to_s
a = NetAddr::CIDR.create(line)
puts "#{a.ip}/#{a.wildcard_mask}"
newfile.write("route = #{a.ip}/#{a.wildcard_mask}\n")
@odytrice
odytrice / fsharp-tutorial.fs
Last active March 3, 2024 04:32
F# Code Samples
// This sample will guide you through elements of the F# language.
//
// *******************************************************************************************************
// To execute the code in F# Interactive, highlight a section of code and press Alt-Enter in Windows or
// Ctrl-Enter Mac, or right-click and select "Send Selection to F# Interactive".
// You can open the F# Interactive Window from the "View" menu.
// *******************************************************************************************************
// For more about F#, see:
@cmpute
cmpute / fastio.hpp
Last active August 11, 2023 07:58
Code Snippets for IO Bursting in OJ
/*
* OJ中加速IO常用的代码片段
* Author Jacob C
* THU_ID 2014010812
*/
//OJ中常用的头文件和预编译指令
#ifndef _OJ_
#define DEBUG
#endif
@shiritrong
shiritrong / gist:d85bb1e16c66d1a09896727780b4fc7c
Last active July 17, 2024 05:04
Windows 7 All Online/Offline [Retail-MAK] Activation Keys
Windows 7 All Online/Offline [Retail-MAK] Activation Keys
=================================================================================
. Run "Command Prompt" as Administrator
. slmgr.vbs -ipk Product Key
. slui4
=================================================================================
Windows 7 Ultimate Retail Phone Activation Keys
RHTBY-VWY6D-QJRJ9-JGQ3X-Q2289
V77DJ-CT8WB-Y3GXT-X3FBP-6F987
JC7BV-94FD2-D86PH-XRMHR-BXKDG
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 22, 2024 06:03
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@vanyle
vanyle / modding_discord.md
Last active June 14, 2024 18:29
Modding the Discord client

Modding the discord client

Disclaimer: Modding the discord client is against Discord's term of service. I'm not responsible if any action is taken against you.

Why modding ?

Modding the client will allow you to customize to:

  • change the appearance of the discord client
  • have script to automaticaly send messages at specific times
  • log messages from a chat into a local file

This guide will explain how to inject js code into the discord client and send messages. I'm assuming you know you to write javascript code and are using Windows.

@vlinx-io
vlinx-io / native-image-reverse.md
Last active April 7, 2024 05:28
NativeImage Reverse Engineering

NativeImage Reverse Engineering

Restoring and protecting Java code is an old and often-discussed issue. Due to the byte-code format used to store Java class files, which contains a lot of meta-information, it can be easily restored to its original code. In order to protect Java code, the industry has adopted many methods, such as obfuscation, bytecode encryption, JNI protection, and so on. However, regardless of the method used, there are still ways and means to crack it.

Binary compilation has always been considered as a relatively effective method of code protection. Java's binary compilation is supported as AOT (Ahead of Time) technology, which means pre-compilation.

However, due to the dynamic nature of the Java language, binary compilation needs to handle issues such as reflection, dynamic proxy, JNI loading, etc., which poses many difficulties. Therefore, for a long time, there has been a lack of a mature, reliable, and adaptable tool for AOT compilation in Java that can be widely applied in p