-
The official Haxe sources:
- https://haxe.org/manual/macro.html
- http://api.haxe.org/haxe/macro/
- http://code.haxe.org/category/macros/
Getting better all the time, this is the definitive guide though quite meaty and requires a good couple of passes before things make sense. Learn from simple examples and practicing, use the manual as a reference.
-
Macronauts: Macro workshop
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 | |
| # video demo at: http://www.youtube.com/watch?v=90xoathBYfk | |
| # written by "mhwombat": https://bbs.archlinux.org/viewtopic.php?id=71938&p=2 | |
| # Based on "snippy" by "sessy" | |
| # (https://bbs.archlinux.org/viewtopic.php?id=71938) | |
| # | |
| # You will also need "dmenu", "xsel" and "xdotool". Get them from your linux | |
| # distro in the usual way. | |
| # |
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
| using UnityEngine; | |
| /* | |
| * Most functions taken from Tween.js - Licensed under the MIT license | |
| * at https://github.com/sole/tween.js | |
| * Quadratic.Bezier by @fonserbc - Licensed under WTFPL license | |
| */ | |
| public delegate float EasingFunction(float k); | |
| public class Easing |
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
| package ; | |
| import luxe.Component; | |
| import luxe.Rectangle; | |
| import luxe.Vector; | |
| class PhysBody { | |
| public var rect:Rectangle; | |
| public var vel:Vector; | |
| public var acc:Vector; |
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
| jq -r '["List", "Card"], ((reduce .lists[] as $list ({}; .[$list.id] = $list.name)) as $lists | .cards[] | select(.closed != true) | [$lists[.idList],.name]) | @csv' <nw3RUeLl.json |
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
| // SpatialHash uniform-grid implementation | |
| // Broad-phase algorithm for collision detection | |
| // Andrei Rudenko // SpatialHash.hx (24.07.2016) | |
| import luxe.Vector; | |
| import luxe.utils.Maths; | |
| class SpatialHash { | |
| public var min(default, null):Vector; |
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
| /////////////////////////////////////////// | |
| // Animation Cubic Bezier easings // | |
| // see - http://matthewlein.com/ceaser // | |
| /////////////////////////////////////////// | |
| // defaults | |
| $ease-linear: "cubic-bezier(0.250, 0.250, 0.750, 0.750)"; | |
| $ease-default: "cubic-bezier(0.250, 0.100, 0.250, 1.000)"; | |
| $ease-in: "cubic-bezier(0.420, 0.000, 1.000, 1.000)"; | |
| $ease-out: "cubic-bezier(0.000, 0.000, 0.580, 1.000)"; |
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 bash | |
| ########################################################################### | |
| # Originally written by: Henrik Bengtsson, 2014 | |
| # https://github.com/HenrikBengtsson/speedtest-cli-extras | |
| # Modified to use IFTTT by: Alasdair Allan, 2015 | |
| # License: GPL (>= 2.1) [http://www.gnu.org/licenses/gpl.html] | |
| ########################################################################### | |
| # Character for separating values | |
| # (commas are not safe, because some servers return speeds with commas) |
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
| # for nvm | |
| export NVM_DIR="$HOME/.nvm" | |
| . "$(brew --prefix nvm)/nvm.sh" | |
| load-nvmrc() { | |
| if [[ -f .nvmrc && -r .nvmrc ]]; then | |
| nvm use | |
| elif [[ $(nvm version) != $(nvm version default) ]]; then | |
| echo "Reverting to nvm default version" | |
| nvm use default |
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/zsh | |
| # git-fshow - git commit browser | |
| # | |
| # https://gist.github.com/akatrevorjay/9fc061e8371529c4007689a696d33c62 | |
| # https://asciinema.org/a/101366 | |
| # | |
| git-fshow() { | |
| local g=( | |
| git log |