Skip to content

Instantly share code, notes, and snippets.

@aras-p
aras-p / preprocessor_fun.h
Last active November 20, 2024 02:29
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@cofyc
cofyc / xrunc
Created January 24, 2015 16:12
A handy tool to compile and execute C source directly.
#!/usr/bin/env python
#
# A handy tool to compile and execute C source directly.
#
# @author Yecheng Fu <[email protected]>
import os
import sys
import tempfile
import subprocess
@cloudwu
cloudwu / inject.lua
Last active March 28, 2023 16:33
Inject code with locals and upvalues
local FUNC_TEMP=[[
local $ARGS
return function(...)
$SOURCE
end,
function()
return {$LOCALS}
end
]]
@cjddmut
cjddmut / EasingFunctions.cs
Last active November 6, 2024 17:11
Easing Functions for Unity3D
/*
* Created by C.J. Kimberlin
*
* The MIT License (MIT)
*
* Copyright (c) 2019
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@cloudwu
cloudwu / mymod.user.lua
Created October 26, 2015 12:05
user defined loader
local M = {}
function M.test(...)
print(...)
end
return M
@NovaSurfer
NovaSurfer / SceneRestart.cs
Last active March 25, 2018 02:50
Restart current scene in Unity 5.0 using new SceneManager
/*
For more details, please follow the link below:
https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager.html
*/
using UnityEngine;
using UnityEngine.SceneManagement;
using System.Collections;
public class SceneRestart : MonoBehaviour {
@sean-lin
sean-lin / click.py
Last active August 10, 2016 04:42
python windows auto click
# -*- coding: utf-8 -*-
import time
import win32con
import win32api
import ctypes
from ctypes import wintypes
byref = ctypes.byref
user32 = ctypes.windll.user32