Skip to content

Instantly share code, notes, and snippets.

@neuronix
neuronix / gist:2016071
Created March 11, 2012 11:20
Rendering dynamic parameters in a dust.js helper
// Handy function to render dynamic parameters in a dust.js helper
function renderParameter(name, chunk, context, bodies, params) {
if (params && params[name]) {
if (typeof params[name] === "function") {
var output = "";
chunk.tap(function (data) {
output += data;
return "";
}).render(params[name], context).untap();
return output;
@neuronix
neuronix / gist:473a38d9fa14690b863f
Created October 30, 2015 08:46
Creating iOS certificates (.p12) for Adobe AIR on Windows with OpenSSL
:: Creating iOS certificates on windows for Adobe AIR
:: Install OpenSSL: https://www.openssl.org/source/
:: 1. Use cmd to get to openssl bin folder
:: 2. run openssl
:: 3. in openssl console: genrsa -out ios_distribution.key 2048
:: 4. in openssl console: req -new -key ios_distribution.key -out CertificateSigningRequest_distribution.certSigningRequest -subj "/emailAddress=<your@email.com>, CN=<YourCompany>, C=<CountryCode:FR>"
:: 5. repeat 4. with "_development" instead of "_distribution"
:: 6. Use both CSR requests on itunes portal to generate the certificate files (.cer)
:: 7. Use this .bat to generate the .p12 files
:: Bonus. Same process to generate push certificates
@neuronix
neuronix / names.py
Last active November 30, 2015 21:40
AS3 pre-build script for debugging anonymous functions in release builds
# Author: @cameron_vdb
#
# Renames anonymous functions in AS3 files with following pattern: _anonymous_myPackage_MyClass_l<line number> (...)
# Allows easy debugging of anonymous functions in release builds at runtime.
# You should run the script in name mode before the build and run it in unname mode after the build to remove function names from your code.
# The script currently only runs on your current project files and does not process referenced projects.
#
# Usage: python names.py <name|unname> <ProjectRootFolder> [<buildType>]
# name to add function names, unname to remove them.
# buildType is optional, if defined, script will only run if buildType == "release"
@neuronix
neuronix / Open_CMD_here.reg
Created December 15, 2015 10:40
Open Windows cmd with current folder location (context menu option)
; Adds a "Open CMD here" option to context menu (right click in a folder) than runs cmd with the current folder location
; Ex. in C:\Users\Peter\MyFolder, right click & select "Open cmd here" will open cmd with C:\Users\Peter\MyFolder>
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\Open CMD here]
@="Open &CMD here"
"Icon"="cmd.exe,0"
[HKEY_CLASSES_ROOT\Directory\Background\shell\Open CMD here\command]
@neuronix
neuronix / TLFCompositor.as
Last active September 8, 2016 14:15
Custom text compositor to enable RTL support in Starling 2.0 using the Text Layout Framework (TLFTextField). Requires including the textlayout.swc and tlfruntime.swc to your project.
package starling.extensions
{
import fl.text.TLFTextField;
import flash.geom.Matrix;
import flash.text.AntiAliasType;
import flash.text.Font;
import flash.text.FontStyle;
import flash.text.TextFormat;
import flash.text.engine.FontLookup;
import starling.display.MeshBatch;
package tests.reboot {
import flash.display.Bitmap;
import flash.display.Sprite;
import flash.ui.Multitouch;
import flash.ui.MultitouchInputMode;
import flash.utils.setTimeout;
import starling.core.Starling;
import starling.display.Image;
import starling.display.Sprite;
import starling.textures.Texture;
@neuronix
neuronix / PositionWindow.au3
Created October 28, 2016 07:58
AutoIt script to position window by name (will position Flash Player window by default)
; AutoIt script to position window by name (will position Flash Player window by default).
; Useful while working on flash projects with FlashDevelop for example, to position the debug window in the same position every launch.
; PositionWindow.exe <title> <mode> <x> <y> <interval>
; title: string to search in window title. Default is "Adobe Flash Player"
; mode: possible values. Default is "loop"
; - loop: will reposition every <interval> milliseconds
; - wait: will poll every <interval>ms until window appears then positions it once
; - once: just positions the window on execution
; x/y: pixels value or center. Defaults are 0
@neuronix
neuronix / adjust_tokens.js
Created February 12, 2019 10:12
Extract Adjust event tokens
/*
1. Open up your adjust app settings
2. Select events
3. Paste & run in console
4. Copy your map EVENT_NAME->EVENT_TOKEN
*/
var tokens = {};
var lis = document.querySelectorAll("[scroll='event-types'] li[event='event']");
lis.forEach(function (li) {