Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
""" Andy Chase | |
>>> [number_to_unique_tuple(i, 256) for i in [0, 1, 2, 255, 256]] | |
[(0,), (1,), (2,), (255,), (0, 1)] | |
>>> [number_to_unique_tuple(i, 256, 1) for i in [0, 1, 2, 255, 256]] | |
[(0, 0), (1, 1), (2, 2), (255, 255), (0, 1)] | |
>>> [number_to_unique_tuple(i, 256) for i in [256*2, (256*256) - 2, (256*256) - 1, 256*256]] | |
[(0, 2), (254, 253), (255, 254), (0, 0, 1)] | |
>>> s = [number_to_unique_tuple(i, 256) for i in range(0,256*256)] | |
>>> len(list(s)) | |
65536 |
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
// Google Forms Slack Notification | |
// Andy Chase <github.com/andychase> | |
// License: CC0 1.0 Universal <creativecommons.org/publicdomain/zero/1.0> | |
// Install 1: This code goes in ( tools > script editor... ) of your google docs form | |
// Install 2: ( resources > current project triggers ) ( [onSubmit], [from Form], [On form submit] ) | |
// Setup 1: Put your slack api url below | |
var POST_URL = "https://hooks.slack.com/services/"; | |
function onSubmit(e) { |
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 demonstrates a performance issue with DiffuseMap/DiffuseColor & directional light/shadow map in JME3 | |
// Issue ticket: https://github.com/jMonkeyEngine/jmonkeyengine/issues/247 | |
// Press Z/X to shift back and forth between the textures to see the performance diffence. | |
import com.jme3.app.SimpleApplication; | |
import com.jme3.input.ChaseCamera; | |
import com.jme3.input.KeyInput; | |
import com.jme3.input.controls.AnalogListener; | |
import com.jme3.light.DirectionalLight; | |
import com.jme3.input.controls.KeyTrigger; |
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
#!python | |
""" A fairly simple way of parsing arguments without using libraries. | |
Licenced: http://creativecommons.org/publicdomain/zero/1.0/ | |
""" | |
import sys | |
def main(_=None, argument_1="", argument_2="", *args): | |
if not argument_1: | |
print("need arg 1!)" |
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
""" USEAGE: xclip -o | python chrome_xxd.py | xxd -r - [destination] | |
To access chrome's cache, go to about:cache in the address bar. | |
Make sure you copy the second section of the hex dump (the first section is the header). | |
""" | |
import sys | |
for line in sys.stdin.readlines(): | |
sys.stdout.write(line[1:].replace(" ", " ")) |
NewerOlder