Skip to content

Instantly share code, notes, and snippets.

@itsff
itsff / Default.tconf
Created February 25, 2015 20:05
Sample tconf script
# Let's do some copies
pub.Symbol = src.Symbol
pub.Trade = src.Trade
pub.Ask = src.Ask
# Blank out pub.Bid
blank({}, {pub.Bid})
# Some simple condition
if src.Bid > 10
@itsff
itsff / logic.tconf
Created March 3, 2015 17:59
Optimization test
pub.Symbol = src.Symbol
pub.Trade = src.Trade
pub.Ask = src.Ask
if src.MsgType == "D"
if src.BatCode == "B"
pub.Junk = veh.Bid
pub.Bid = 123
end
end
@itsff
itsff / docker-compose.yml
Last active January 6, 2016 19:30
Sample docker-compose.yml
# Reverse proxy for routing web traffic
web_proxy:
image: dmp1ce/nginx-proxy-letsencrypt
restart: always
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/tmp/docker.sock
- ~/sites/certs:/etc/nginx/certs
@itsff
itsff / README.markdown
Created February 19, 2016 22:10 — forked from alloy/README.markdown
Learn the LLVM C++ API by example.

The easiest way to start using the LLVM C++ API by example is to have LLVM generate the API usage for a given code sample. In this example it will emit the code required to rebuild the test.c sample by using LLVM:

$ clang -c -emit-llvm test.c -o test.ll
$ llc -march=cpp test.ll -o test.cpp
@itsff
itsff / reverse_scroll.ps1
Created September 2, 2016 20:09
Reverse mouse wheel scroll direction on Windows
# Copied from: http://superuser.com/a/364353
# Change registry settings
# Reverse mouse wheel scroll FlipFlopWheel = 1
# Normal mouse wheel scroll FlipFlopWheel = 0
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 }
@itsff
itsff / jni_string.hpp
Last active September 30, 2016 21:23
RAII JNI string
#include <jni.h>
class jni_string
{
public:
jni_string (JNIEnv *env,
jstring javaString)
: _env(env)
, _javaString(javaString)
{
@itsff
itsff / process_hollowing.c
Created March 8, 2017 21:30
A pretty neat exploit called Process Hollowing. You start a process suspended, then replace its content with the content of another.
#include <stdio.h>
#include <Windows.h>
#include <winternl.h>
#pragma comment(lib,"ntdll.lib")
EXTERN_C NTSTATUS NTAPI NtTerminateProcess(HANDLE,NTSTATUS);
EXTERN_C NTSTATUS NTAPI NtReadVirtualMemory(HANDLE,PVOID,PVOID,ULONG,PULONG);
EXTERN_C NTSTATUS NTAPI NtWriteVirtualMemory(HANDLE,PVOID,PVOID,ULONG,PULONG);
EXTERN_C NTSTATUS NTAPI NtGetContextThread(HANDLE,PCONTEXT);
@itsff
itsff / SAStoken.cs
Created July 12, 2017 18:40 — forked from sedouard/SAStoken.cs
Generates a SAS Token for Azure REST Api Calls (Particularly for Service Bus Services like Event Hub & Queues)
/// <summary>
/// Code for generating of SAS token for authorization with Service Bus
///
/// This handy function can be found on this helpful blog post:
/// http://developers.de/blogs/damir_dobric/archive/2013/10/17/how-to-create-shared-access-signature-for-service-bus.aspx
/// </summary>
/// <param name="resourceUri"></param>
/// <param name="keyName"></param>
/// <param name="key"></param>
/// <returns></returns>
@itsff
itsff / filip.cpp.cfg
Last active June 20, 2018 20:51
Filip's Canonical Coding Style - config files for uncrustify
# Uncrustify 0.64
#
# Usage:
# uncrustify -c /path/to/filip.cpp.cfg --replace --no-backup /path/to/cpp/or/h/file
#
#
# Filip's Canonical Coding Style (C++)
#
@itsff
itsff / biz_day.py
Created February 3, 2019 05:08
Finding next business day in Python
from datetime import datetime, timedelta
def find_next_biz_day(days_away=1,
start=None,
is_holiday=lambda d: False):
"""
Finds a business day that is N days away
:param days_away: Days away (positive or negative)
:param start: Starting date (today if None)