start new:
tmux
start new with session name:
tmux new -s myname
| # Function for setting up precompiled headers. Usage: | |
| # | |
| # add_library/executable(target | |
| # pchheader.c pchheader.cpp pchheader.h) | |
| # | |
| # add_precompiled_header(target pchheader.h | |
| # [FORCEINCLUDE] | |
| # [SOURCE_C pchheader.c] | |
| # [SOURCE_CXX pchheader.cpp]) | |
| # |
| If you want to clone an svn repository with git-svn but don't want it to push all the existing branches, here's what you should do. | |
| * Clone with git-svn using the -T parameter to define your trunk path inside the svnrepo, at the same time instructing it to clone only the trunk: | |
| git svn clone -T trunk http://example.com/PROJECT | |
| * If instead of cloning trunk you just want to clone a certain branch, do the same thing but change the path given to -T: | |
| git svn clone -T branches/somefeature http://example.com/PROJECT |
| #!/usr/bin/python | |
| # | |
| # git-slim | |
| # | |
| # Remove big files from git repo history. | |
| # | |
| # Requires GitPython (https://github.com/gitpython-developers/GitPython) | |
| # | |
| # References: | |
| # - http://help.github.com/remove-sensitive-data/ |
| #!/usr/bin/env python | |
| """ | |
| Assist in performing online Text-To-Speech and immediate playback. | |
| """ | |
| import sys | |
| import requests | |
| import urllib | |
| import tempfile | |
| import commands |
| // Type-safe varargs with C++11 variadic templates. | |
| // | |
| // Andreas Fredriksson <deplinenoise at gmail dott com> | |
| // | |
| // This code is in the public domain. | |
| #include <stdio.h> | |
| #include <stdarg.h> |
| #!/usr/bin/env python3 | |
| # | |
| # Copyright 2014-2020 Cameron Hart <[email protected]>. | |
| # All rights reserved. | |
| # | |
| # Redistribution and use in source and binary forms, with or without | |
| # modification, are permitted provided that the following conditions are met: | |
| # | |
| # 1. Redistributions of source code must retain the above copyright notice, | |
| # this list of conditions and the following disclaimer. |
| static void check_for_leaks() | |
| { | |
| GLuint max_id = 10000; // better idea would be to keep track of assigned names. | |
| GLuint id; | |
| // if brute force doesn't work, you're not applying it hard enough | |
| for ( id = 1 ; id <= max_id ; id++ ) | |
| { | |
| #define CHECK( type ) if ( glIs##type( id ) ) fprintf( stderr, "GLX: leaked " #type " handle 0x%x\n", (unsigned int) id ) | |
| CHECK( Texture ); |
| // C/C++ tips for using printf-style functions | |
| // Lots of manipulation can be expressed simply and fast with printf-style formatting | |
| // Also helps reducing the number of temporaries, memory allocations or copies | |
| // ( If you are looking for a simple C++ string class that is printf-friendly and not heap-abusive, | |
| // I've been using this one: https://github.com/ocornut/Str ) | |
| // If you are interested in a FASTER implementation of sprintf functions, see stb_sprintf.h | |
| // https://github.com/nothings/stb/blob/master/stb_sprintf.h | |
| // How to concatenate non-zero terminated strings |