Isometric cubes using svg tranforms. This uses SVG transforms: skew, rotate, and scale, to make isometric cubes of any projections angle (26.6, 30, 45). Good for making SVG sprites for isometric games.
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
/** | |
* Move the given display object towards the x/y coordinates at a steady velocity. | |
* If you specify a maxTime then it will adjust the speed (over-writing what you set) so it arrives at the destination in that number of seconds. | |
* Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms. | |
* Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. | |
* Note: The display object doesn't stop moving once it reaches the destination coordinates. | |
* Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all) | |
* | |
* @method Phaser.Physics.IsoArcade#moveToXY | |
* @param {any} displayObject - The display object to move. |
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
/* | |
* For Phaser.Plugin.IsoArcard, this helps displayObject placement by moving it above others. This is | |
* done by moving them up until they no longer overlap with anything. | |
* @method Phaser.Physics.IsoArcade#placeAboveOverlaps | |
* @param {any} displayObject - The display object to move. | |
* @param {any} groupCollision - The the group of displayObjects to check for overlaps with. | |
* @param {number} [startZ=displayObject.isoZ] - The speed it will move, in pixels per second (default is 60 pixels/sec) | |
*/ | |
function placeAboveOverlaps(displayObject,groupCollision,startZ){ | |
var overlap |
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
/* | |
* Uses casperjs to get api tokens from https://ucwa.skype.com/login/explore | |
* | |
* @outputs: | |
* this will output ucwaTokens.json to current directory | |
* | |
* If debug is true, then it will output screenshots to ./debug-images/<name>.png | |
* | |
* | |
* @run |
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
# configure apt to not install reccomendations | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN echo 'APT::Install-Recommends 0;' >> /etc/apt/apt.conf.d/01norecommends \ | |
&& echo 'APT::Install-Suggests 0;' >> /etc/apt/apt.conf.d/01norecommends | |
RUN apt-get update \ | |
&& apt-get install -y netcat \ | |
&& rm -rf /var/lib/apt/lists/* | |
# This uses the apt proxy only if present. It checks on port 3142 of the host/gateway, and returns DIRECT for no proxy, |
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 code will use the devpi cache if it can be found | |
# otherwise fail with a few complaints | |
RUN export HOST_IP=$(ip route| awk '/^default/ {print $3}') \ | |
&& mkdir -p ~/.pip \ | |
&& echo [global] >> ~/.pip/pip.conf \ | |
&& echo extra-index-url = http://$HOST_IP:3141/app/dev/+simple >> ~/.pip/pip.conf \ | |
&& echo [install] >> ~/.pip/pip.conf \ | |
&& echo trusted-host = $HOST_IP >> ~/.pip/pip.conf \ | |
&& cat ~/.pip/pip.conf | |
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
#!/bin/bash | |
sethost () { # set up docker hostnames | |
# replace everything in line with the right IP, with $IP $MACHINE | |
D_MACHINE=$1 | |
echo "Update host file for machine=$D_MACHINE" | |
DATE=$(date -u +%s) | |
echo "backing up hosts to /tmp/hosts-$(date -u +%s)" | |
cp /etc/hosts /tmp/hosts-$(date -u +%s) |
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
""" | |
Convert .gitignore to .dockerignore: quick and dirty. | |
This is a quick and dirty script to convert this: | |
`__pycache__/` | |
Into this: | |
``` | |
__pycache__ | |
*/__pycache__ |
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
""" | |
Visualize a list of search suggestions as an ascii trie. | |
Inputs: | |
- searches: a list of strings, each representing a sentance | |
Usage: | |
>>>searches=[ | |
'online calculator', | |
'online photo editor', |
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 is too show the use of waiting for a jquery selector in the browser | |
* using promises. Much like how webdriverio works from outside the browser. | |
* | |
* Tested with jQuery v1.11.3 and chrome Version 48.0.* (64-bit) | |
**/ | |
/** | |
* Wait for a jquery css selector |