Skip to content

Instantly share code, notes, and snippets.

View nicolas17's full-sized avatar

Nicolás Alvarez nicolas17

  • Buenos Aires, Argentina
View GitHub Profile
class Quux;
class Foo {
public:
void (Quux::*ptr)();
};
int main() {
Foo x;
printf("The pointer to member function is %d bytes\n", sizeof(x.ptr));
@nicolas17
nicolas17 / gist:2663579
Created May 12, 2012 01:28 — forked from rubic/gist:1644599
setuid via subprocess.Popen
#!/usr/bin/env python
import os, subprocess
def change_identity(uid, gid):
def func():
os.setgid(uid)
os.setuid(gid)
return func
cmd = ['uname', '-a']
@nicolas17
nicolas17 / eval.h
Created October 11, 2015 01:27
C preprocessor evilness
#if EVAL_INPUT % 10 == 0
#define EVAL_D1 0
#elif EVAL_INPUT % 10 == 1
#define EVAL_D1 1
#elif EVAL_INPUT % 10 == 2
#define EVAL_D1 2
#elif EVAL_INPUT % 10 == 3
#define EVAL_D1 3
#elif EVAL_INPUT % 10 == 4
#define EVAL_D1 4
@nicolas17
nicolas17 / gist:85f094fd0753cda1e116
Created November 23, 2015 01:31
ld crash compiling a simple iOS tweak
{"bug_type":"109","os_version":"iPhone OS 8.4 (12H143)","build_version":"","blame":[],"symbolicated":true,"app_name":"ld","name":"ld","is_first_party":true,"app_version":"","share_with_app_devs":true,"slice_uuid":"10e851cd-afcd-30ed-a377-c6d95d76aea8"}
Incident Identifier: FE48D1A6-C34A-4B90-BEBD-5571960FA5E8
CrashReporter Key: 939c15172497609b871a2dadc5a86cf4c5a2a190
Hardware Model: iPod5,1
Process: ld [10606]
Path: /usr/bin/ld
Identifier: ld
Version: ???
Code Type: ARM (Native)
Parent Process: clang [10605]
bashdb<20> help info
List of info subcommands:
info args -- Argument variables (e.g. $1, $2, ...) of the current stack frame.
info breakpoints -- Status of user-settable breakpoints
info display -- Show all display expressions
info files -- Source files in the program
info functions -- All function names
info line -- list current line number and and file name
info program -- Execution status of the program.
@nicolas17
nicolas17 / aita.md
Created December 20, 2015 01:34
App in the Air experience
  1. Open app for the first time.
    • There seems to be a motion effect in the world map when I tilt the device. If the idea is to make the world map appear in the background and the application name in the foreground, the motion effect is backwards.
  2. Go to Add flight.
  3. Enter LA as an airline code.
  4. The "enter flight number" screen appears.
    • There is no blinking cursor in the text field to enter the number, so it looks as if the field wasn't selected. I kept tapping it to make it selected, before I noticed I could just type the number on the keyboard. It also means I can't move the cursor, or paste...
    • There is no limit to how many digits I can type, even though flight numbers can't be longer than 4 digits.
    • Why can't I just type "LA 2426" in the previous screen? Why force me through two steps?
  5. Enter 2426 and tap Done.
  6. As the date, select Nov 29th and tap Search.
create repository foundation-git
end repository
match /foundation/trunk/
repository foundation-git
branch master
end match
match /foundation/branches/([^/]+)/
repository foundation-git
@nicolas17
nicolas17 / circulos.md
Last active December 24, 2015 05:49
Polígonos circulares de escuelas en Argentina
@nicolas17
nicolas17 / CMakeLists.txt
Last active December 27, 2015 22:59 — forked from Madsy/gist:7384008
SET( ${PROJECT_NAME}_SOURCES
main.cpp
)
#main.x depends on main.cpp (is generated based on main.cpp)
#main.o depends on main.cpp and main.x (main.x is included in main.cpp)
#So if main.cpp changes, first run the tool to create main.x,
#then run cc to create main.o from main.cpp and main.x
ADD_CUSTOM_COMMAND(
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
#include "preproc.h"
#ifndef GL_KHR_debug
int code() {
return 42;
}
#endif