THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
| /* | |
| ptr_inspect.c | |
| Demonstration code; shows how to trace the system calls in a child | |
| process with ptrace. Only works on 64-bit x86 Linux for now, I'm | |
| afraid. (Even worse, it's only tested on Linux 2.6....) | |
| The callname() function looks clunky and machine-generated because it | |
| *is* clunky and machine-generated. | 
| #!/bin/bash | |
| # Watch paths (given as arguments), automatically build when something changes. | |
| # The script does a couple opinionated things to make my life easier: | |
| # | |
| # * Terminal scrollbuffer is reset before each iteration, simplifying scrolling. | |
| # * I use a filter script to colorize gcc output (clang errors would be nicer). | |
| # * Output is copied to a log file (/tmp/build.log). | |
| # - I open this file in Sublime or vim, which reloads the file on change (each build). | |
| # | |
| # Usage: | 
| #include <cstring> // memcpy | |
| #include <type_traits> // is_trivially_copyable | |
| // http://src.chromium.org/viewvc/chrome/trunk/src/base/basictypes.h?view=markup | |
| // bit_cast<Dest,Source> is a template function that implements the | |
| // equivalent of "*reinterpret_cast<Dest*>(&source)". We need this in | |
| // very low-level functions like the protobuf library and fast math | |
| // support. | |
| // | 
| ;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY | |
| ;by doppelganger ([email protected]) | |
| ;This file is provided for your own use as-is. It will require the character rom data | |
| ;and an iNES file header to get it to work. | |
| ;There are so many people I have to thank for this, that taking all the credit for | |
| ;myself would be an unforgivable act of arrogance. Without their help this would | |
| ;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into | |
| ;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no | 
| /* | |
| * I add this to html files generated with pandoc. | |
| */ | |
| html { | |
| font-size: 100%; | |
| overflow-y: scroll; | |
| -webkit-text-size-adjust: 100%; | |
| -ms-text-size-adjust: 100%; | |
| } | 
| package main | |
| import ( | |
| "github.com/guelfey/go.dbus" | |
| "log" | |
| "bufio" | |
| "os" | |
| ) | |
| func main() { | 
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
| /* http://redd.it/2z68di */ | |
| #define _BSD_SOURCE // MAP_ANONYMOUS | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #include <string.h> | |
| #include <sys/mman.h> | |
| #define PAGE_SIZE 4096 | 
| #include <iostream> | |
| using namespace std; | |
| // TypeValue is a type and a value at the same time. | |
| // Each ID is a type, and there can be only one value of this type | |
| // This prevents (only in runtime) construction of two vectors with the same Length variable, but of different actual lengths | |
| template<int ID> | |
| class TypeValue | 
| // Sean Parent. Inheritance Is The Base Class of Evil. Going Native 2013 | |
| // Video: https://www.youtube.com/watch?v=bIhUE5uUFOA | |
| // Code : https://github.com/sean-parent/sean-parent.github.io/wiki/Papers-and-Presentations | |
| /* | |
| Copyright 2013 Adobe Systems Incorporated | |
| Distributed under the MIT License (see license at | |
| http://stlab.adobe.com/licenses.html) | |
| This file is intended as example code and is not production quality. |