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
// paste this into your console | |
// Warning: only do this after thoroughly comprehending it because pasting mystery code into your console is bad :p | |
var doEv=ev=>s=>document.dispatchEvent(new KeyboardEvent(ev,{bubbles:1,keyCode:s.toLowerCase().charCodeAt(0)-32})); | |
var press=doEv("keydown"); | |
var release=doEv("keyup"); | |
var readGamepad = function() { | |
if(navigator.getGamepads()[0].axes[1]>.5) { press("s"); } else { release("s"); } | |
if(navigator.getGamepads()[0].axes[1]<-.5) { press("w"); } else { release("w"); } |
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
class STIXPackage: | |
def to_xml(self, include_namespaces=True, include_schemalocs=False, | |
ns_dict=None, schemaloc_dict=None): | |
# do things | |
# monkey patch | |
global __old_to_xml_clobbered_by_stix_edh | |
__old_to_xml_clobbered_by_stix_edh = stix.core.stix_package.STIXPackage.to_xml | |
def new_to_xml(self, ns_dict=None, *args, **kwargs): | |
if ns_dict is None: ns_dict = {} |
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
alert(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
/* | |
Sample code for a "Battle for the Petri Dish" cell | |
Released under the terms of the WTF Public License | |
No warranty express or implied is granted, etc, etc. | |
I just hacked this together very quickly; improvements are welcome, so please fork the Gist if you like. | |
*/ | |
import java.io.BufferedReader; |
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
/* | |
Sample code for a "Battle for the Petri Dish" cell | |
Released under the terms of the WTF Public License, | |
No warranty express or implied is granted, etc, etc. | |
I just hacked this together very quickly; improvements are welcome, so please fork the Gist if you like. | |
*/ | |
// used in defining cell spec |
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/python | |
# | |
# Sample code for a "Battle for the Petri Dish" cell | |
# | |
# Released under the terms of the WTF Public License, | |
# No warranty express or implied is granted, etc, etc. | |
# | |
# I just hacked this together very quickly; improvements are welcome, so please fork the Gist if you'd like to share your improvements. | |
import sys |
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
/* | |
Node.js implementation of the "Battle for the Petri Dish" driver | |
Copyright (c) 2014, Andrew P. Sillers | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. |