Skip to content

Instantly share code, notes, and snippets.

View eltongo's full-sized avatar
:shipit:
Shipping code

Elton eltongo

:shipit:
Shipping code
View GitHub Profile
@eltongo
eltongo / PaginatedRawQuerySet.py
Created May 11, 2017 16:41
A subscriptable RawQuerySet replacement in Django (tested in Django 1.11 on Python 3)
class PaginatedRawQuerySet(RawQuerySet):
def __init__(self, raw_query, **kwargs):
super(PaginatedRawQuerySet, self).__init__(raw_query, **kwargs)
self.original_raw_query = raw_query
self._result_cache = None
def __getitem__(self, k):
"""
Retrieves an item or slice from the set of results.
"""
@eltongo
eltongo / unescape.c
Created January 15, 2017 23:15
Unescape URL (percent) encoding in C
// convert a hexadecimal digit from 0 to f to its decimal counterpart
int hex_to_int(char hexChar) {
if (hexChar >= '0' && hexChar <= '9') {
return hexChar - '0';
} else if (hexChar >= 'a' && hexChar <= 'f') {
return hexChar - 'a' + 10;
}
return -1;
}
@eltongo
eltongo / drop_payload.c
Created December 19, 2016 01:26
Download files via HTTP through Ian Beer's exploit
/* J. Levin has compiled a bunch of Apple opensource utilites for arm64
* You can get them from his site here: http://newosxbook.com/tools/iOSBinaries.html
*
* Follow the link to "The 64-bit tgz pack"
*
* Unpack the tarball into a directory called iosbinpack64 and drag-and-drop
* that directory into the directory with all the source files in in XCode
* so that it ends up in the .app bundle
*
* I (Elton) have added the ability to download files from your iPhone using your browser.