Skip to content

Instantly share code, notes, and snippets.

View remram44's full-sized avatar

Remi Rampin remram44

View GitHub Profile
@remram44
remram44 / logstack.py
Created September 13, 2013 20:43
Adds context to your stack traces
import contextlib
import linecache
import logging
import sys
import traceback
try:
import cStringIO as StringIO
except ImportError:
import StringIO
C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h lists:
#define STATUS_WAIT_0 ((DWORD )0x00000000L)
#define STATUS_ABANDONED_WAIT_0 ((DWORD )0x00000080L)
#define STATUS_USER_APC ((DWORD )0x000000C0L)
#define STATUS_TIMEOUT ((DWORD )0x00000102L)
#define STATUS_PENDING ((DWORD )0x00000103L)
#define STATUS_SEGMENT_NOTIFICATION ((DWORD )0x40000005L)
#define STATUS_FATAL_APP_EXIT ((DWORD )0x40000015L)
#define STATUS_GUARD_PAGE_VIOLATION ((DWORD )0x80000001L)
@remram44
remram44 / Makefile
Last active January 1, 2016 01:28
Reddit Challenge #135 - De Morgan's Law http://redd.it/1qira9
CC=gcc
CXX=g++
CXXFLAGS=-std=c++11
.PHONY: all small full clean
all: small full
small: small.exe
full: full.exe
@remram44
remram44 / CMakeLists.txt
Created January 20, 2014 20:21
Object registry
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
set(CMAKE_CXX_FLAGS "-g -Wall")
PROJECT(mark_fields)
# Sets up project-wide include dirs
INCLUDE_DIRECTORIES("${PROJECT_SOURCE_DIR}")
INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
# Builds proxychain tool
ADD_EXECUTABLE(test main.cpp registered_object.cpp)
@remram44
remram44 / o.cpp
Last active August 29, 2015 13:56
o/ \o/
#include <cassert>
#include <chrono>
#include <iostream>
#include <random>
#include <string>
#include <thread>
#define count(x) (sizeof(x)/sizeof(*(x)))
std::mt19937 rnd(std::random_device{}());
#-------------------------------------------------
#
# Project created by QtCreator 2014-02-28T17:28:33
#
#-------------------------------------------------
QT += core gui opengl openglextensions
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
# -*- encoding: utf-8 -*-
import sys
# Complicated stuff
import sip
api2_classes = [
'QData', 'QDateTime', 'QString', 'QTextStream',
'QTime', 'QUrl', 'QVariant']
for cl in api2_classes:
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@remram44
remram44 / https.py
Created April 16, 2014 21:35 — forked from schlamar/gist:2993700
Secure usage of urllib2; default doesn't check SSL certificates at all
# Python's handling of certificate verification is irresponsible and wrong.
# Having to include the code below to get what should be the only acceptable
# default behavior is a shame
# Code from https://gist.github.com/schlamar/2993700
import httplib
import urllib2
import ssl
import contextlib
import os
import sys
import tarfile
import traceback
VERSION = sys.version_info[0]
PY3 = VERSION == 3