This file contains hidden or 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
| <?php | |
| function is_assoc($arr) { | |
| return array_keys($arr) !== range(0, count($arr) - 1); | |
| } |
This file contains hidden or 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
| <target name="phpunit"> | |
| <exec dir="${basedir}" executable="bash" newenvironment="false" failonerror="true"> | |
| <arg value="somescript.sh"/> | |
| </exec> | |
| </target> |
This file contains hidden or 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
| #!/bin/bash | |
| # this mitigates this issue with Xdebug, PHPUnit, code coverage and Rediska: | |
| # http://bugs.xdebug.org/view.php?id=670 | |
| export USE_ZEND_ALLOC=0 | |
| /usr/bin/phpunit --configuration tests/phpunit.xml --log-junit build/logs/junit.xml --coverage-clover build/logs/clover.xml tests |
This file contains hidden or 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
| #!/bin/bash | |
| NODE=`which node` | |
| if [ -z "$NODE" ]; then | |
| echo "no node on path?" | |
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| fi |
This file contains hidden or 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
| function webGLStart() { | |
| cJ = document.getElementById("game-canvas"); | |
| !cD(cJ) || (cK = document.getElementById("ctrl-canvas"), cL = cK.getContext("2d"), cP(null, !0), cN.showStartScreen(cL), cE.init($("#shadersFrame").contents().find("#phong-fs"), $("#shadersFrame").contents().find("#phong-vs")), window.onresize = cP, $("#fpsui").text("FPS: 0"), cl("models/bikePlayer2.json", "inlined", "bike", ck), cl("models/lifeWheel.json", "indexed", "life", ck), cb.explode = { | |
| ring: {} | |
| }, Y(cb.explode), bY(), WebGLUtils.requestAnimationFrame(cJ, cA), setInterval(cB, 1e3)) | |
| } | |
| function cP(a, b) { | |
| var c = 20; | |
| drawDiv = document.getElementById("canvas-container"); | |
| var d = Math.round(drawDiv.offsetWidth / c) * c; |
This file contains hidden or 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
| /// <summary> | |
| /// plain string -> sha1 string implementation, behaves identically to php's sha1() function. | |
| /// </summary> | |
| /// <param name="input"> | |
| /// A <see cref="System.String"/> | |
| /// </param> | |
| /// <returns> | |
| /// A <see cref="System.String"/> | |
| /// </returns> | |
| public static string sha1(string input) { |
This file contains hidden or 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 | |
| # This software code is made available "AS IS" without warranties of any | |
| # kind. You may copy, display, modify and redistribute the software | |
| # code either by itself or as incorporated into your code; provided that | |
| # you do not remove any proprietary notices. Your use of this software | |
| # code is at your own risk and you waive any claim against Amazon | |
| # Digital Services, Inc. or its affiliates with respect to your use of | |
| # this software code. (c) 2006-2007 Amazon Digital Services, Inc. or its | |
| # affiliates. |
This file contains hidden or 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
| SCRIPTDIR=$(cd `dirname $0` && pwd) |
This file contains hidden or 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
| from optparse import OptionParser | |
| parser = OptionParser() | |
| parser.add_option("-c", | |
| "--count", | |
| dest="count", | |
| help="how many?.", | |
| default=10 | |
| ) | |
| (options, args) = parser.parse_args() |
This file contains hidden or 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
| var sys = require('sys'); | |
| var L = function(str) {console.log(str)} | |
| function xor_str(subject, key) { | |
| var the_res = ""; | |
| for (i = 0; i < subject.length; i++) { | |
| var cur = key.charCodeAt((i % key.length)); | |
| var c = String.fromCharCode(cur ^ subject.charCodeAt(i)); | |
| the_res += c; | |
| } |