This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$foo = array(-1, NULL, 0, NULL, 0, NULL, -1); | |
echo "unsorted\n"; | |
print_r($foo); | |
sort($foo); | |
echo "sorted once\n"; | |
print_r($foo); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Pack this into an object file with ld: ld -r -b binary -o hello.o hello.lua | |
print "Hello, World!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
sys.path.insert(0, '/System/Library/PrivateFrameworks/LLDB.framework/Resources/Python') | |
import lldb | |
dbg = lldb.SBDebugger.Create() | |
dbg.SetAsync(False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if [%6]==[] goto error | |
@goto ok | |
:error | |
@echo USAGE: video2gif START_TIME DURATION WIDTH FRAME_RATE (DITHER_OPTIONS) (CROP_RECTANGLE width:height:x:y) INPUT OUTPUT | |
@goto end | |
:ok | |
@set PALETTE="%TEMP%\palette.png" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# script to extract music from a pico-8 | |
# requires exporting sounds from the pico-8 first! | |
# run as: python extract-music.py mygame.p8 sound%d.wav music%d.wav | |
# by eevee, do what you like with this code | |
from __future__ import print_function | |
import argparse | |
import struct | |
import wave |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Inspired by the following sentence that I ran across this morning: | |
# | |
# "f_lineno is the current line number of the frame - writing to | |
# this from within a trace function jumps to the given line | |
# (only for the bottom-most frame). A debugger can implement a | |
# Jump command (aka Set Next Statement) by writing to f_lineno." | |
# | |
# https://docs.python.org/2/reference/datamodel.html | |
# | |
# There is an older implementation of a similar idea: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
for i in range(0, 100): | |
if not i % 15: | |
random.seed(1178741599) | |
print [i+1, "Fizz", "Buzz", "FizzBuzz"][random.randint(0,3)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This GIST has been transformed into a Git repository and does not receive updates anymore | |
# | |
# Please visit the github repo to get a current list | |
# https://github.com/Neo23x0/ti-falsepositives/ | |
# Hashes that are often included in IOC lists but are false positives | |
HASH_WHITELIST = [ | |
# Empty file | |
'd41d8cd98f00b204e9800998ecf8427e', | |
'da39a3ee5e6b4b0d3255bfef95601890afd80709', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import getopt | |
from PIL import Image | |
xterm256colors = [ # http://pln.jonas.me/xterm-colors | |
(0, (0x00, 0x00, 0x00)), # SYSTEM | |
(1, (0x80, 0x00, 0x00)), # SYSTEM | |
(2, (0x00, 0x80, 0x00)), # SYSTEM | |
(3, (0x80, 0x80, 0x00)), # SYSTEM |
OlderNewer