Skip to content

Instantly share code, notes, and snippets.

View chuckleplant's full-sized avatar

Sergio Basurco chuckleplant

View GitHub Profile
@chuckleplant
chuckleplant / MouseControl.h
Last active April 12, 2022 16:39
Mouse control for Windows in C++. Dependencies: User32 Windows library.
#ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x500
#endif
#include "Winuser.h"
class ofxMouse
{
public:
static enum MouseEventFlags
{
@chuckleplant
chuckleplant / DisableStartupRepair.bat
Last active August 29, 2015 14:14
Disable Windows Startup Repair
bcdedit /set {default} recoveryenabled No
bcdedit /set {default} bootstatuspolicy ignoreallfailures
@chuckleplant
chuckleplant / Running Several ofApps
Last active August 29, 2015 14:21
Run several ofApps for OF v0.8.4
void resetWindow()
{
ofAppGLFWWindow * glfwWindow = dynamic_cast<ofAppGLFWWindow*>(ofGetWindowPtr());
GLFWwindow* windowP = glfwWindow->getGLFWWindow();
glfwSetWindowShouldClose(windowP, 0);
}
void removeOfAppListeners()
{
ofRemoveListener(ofEvents().setup,ofGetAppPtr(),&ofBaseApp::setup,OF_EVENT_ORDER_APP);
// GLSL
const float pixelDepth = 256.0f;
const vec4 bitSh = vec4(
pixelDepth * pixelDepth * pixelDepth,
pixelDepth * pixelDepth,
pixelDepth,
1.);
const vec4 bitShifts = vec4(1.) / bitSh;
vec2 decodeFloats16()
@chuckleplant
chuckleplant / WindowsCommandOutput.cpp
Created September 9, 2016 07:54
Execute windows command and get results as string | Capture Output of Spawned Process to string
//
// Execute a command and get the results in a CString. (Only standard output)
//
CStringA ExecCmd(
const wchar_t* cmd // [in] command to execute
)
{
CStringA strResult;
HANDLE hPipeRead, hPipeWrite;
@chuckleplant
chuckleplant / RebuildIconCache_Command.bat
Created September 21, 2016 10:03
Rebuild Icon Cache - Windows
rem run this in WIN+R
ie4uinit.exe -ClearIconCache
rem credit : http://superuser.com/a/499079
@chuckleplant
chuckleplant / To_MP3_Windows.bat
Created January 5, 2017 09:34
Converts files to MP3 using FFMPEG, on Windows. Note that you can change m4a to almost any other audio format and ffmpeg will still convert.
@echo off
FOR /F "tokens=*" %%G IN ('dir /b *.m4a') DO ffmpeg -i "%%G" -acodec libmp3lame -ab 128k "%%G.mp3"
@chuckleplant
chuckleplant / config.sh
Created January 29, 2018 20:09
Unity config OSX - Windows mergetool
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = https://github.com/chuckleplant/GGJ2018.git
fetch = +refs/heads/*:refs/remotes/origin/*
@chuckleplant
chuckleplant / google-locs-geotagger.py
Last active October 8, 2023 20:20
Little script that will automatically add GPS data to Jpeg images based on your Google location history, you can get it from https://takeout.google.com/
import os
import glob
import argparse
import json
import datetime
import time
from bisect import bisect_left, bisect_right
from PIL import Image
from pexif import JpegFile