Skip to content

Instantly share code, notes, and snippets.

@mountainstorm
mountainstorm / GaplessLoopedSound.as
Last active December 7, 2020 09:34
Starling2D extension to allow playing of looped mp3's without the 'click' as it loops (due to the issue with mp3 frame sizes).
/*
* Copyright (c) 2013 Mountainstorm
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@mountainstorm
mountainstorm / export-group.py
Created December 24, 2013 11:42
Blender python export script; allows you to render out a scene but with everything not in the chosen group as transparent. Useful if you want to create sprites or use bits of a scene as 2d layers.
# coding: utf-8
# Copyright (c) 2013 Mountainstorm
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@mountainstorm
mountainstorm / texture-atlas.py
Created December 24, 2013 11:44
Simple script which takes a selection of files and creates a Starling 2D texture texture & atlas; cropping any redundant border (transparent bits). Requires Pillow (new PIL - 'easy_install Pillow')
#!env python3
# coding: utf-8
# Copyright (c) 2013 Mountainstorm
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@mountainstorm
mountainstorm / jquery.disableswipeback.js
Last active August 7, 2019 10:21
jquery plugin to disable back/forward swiping on OSX Safari
/*
* Copyright (c) 2014 Mountainstorm
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@mountainstorm
mountainstorm / jquery.find.highlight.js
Last active August 29, 2015 13:57
Simple highlight to allow dynamic highlighting of a search pattern
/*
* Copyright (c) 2014 Mountainstorm
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@mountainstorm
mountainstorm / GraphicsContext.py
Created August 28, 2014 06:45
Console graphic primitives; basic drawing primitives, boxes, lines etc implemented in console control codes. Was part of MtUI when it was going to be console based but not used anymore. Saved here as its pretty fun code and I didn't want to loose it
#!/usr/bin/python
# coding: utf-8
# Copyright (c) 2013 Mountainstorm
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@mountainstorm
mountainstorm / enumeration.py
Created September 9, 2014 18:20
hfsplus structures, allows parsing the hfsplus file structure and changing it.
#!/usr/bin/python
# coding: latin-1
# Copyright (c) 2013 Mountainstorm
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@mountainstorm
mountainstorm / trackdiff.py
Created September 9, 2014 22:23
Simple unified diff processing script, which takes lineno's for file a, and tells you where they will be in file b. The idea is it should be really useful for tracking issues once you've done a source code review
#!/usr/bin/python
# coding: utf-8
# Copyright (c) 2014 Mountainstorm
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@mountainstorm
mountainstorm / search.py
Last active August 29, 2015 14:15
Security CTF search script; DONT use unless you want a script which allows a fun way to test Shellshock
#!/usr/bin/python
# coding: utf-8
import sys
import os
import re
import subprocess
import cgi
import cgitb
@mountainstorm
mountainstorm / gist:e459b8ddb39b0b494ba2
Created April 23, 2015 07:28
Pretty Graphviz charts
# coding: utf-8
import xml.etree.ElementTree as ET
GRAPHVIZ_PT_2SVG = 3.5 # conversion from gv pt size to svg units
namespaces = {
u'svg': u'http://www.w3.org/2000/svg',
u'xlink': u'http://www.w3.org/1999/xlink'