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
const DEBUG = false; | |
const logDebug = function(_target: any, key: string, descriptor: PropertyDescriptor): any { | |
const originalMethod = descriptor.value; | |
descriptor.value = function(...args: any[]) { | |
const functionName = key; | |
console.log(functionName + "(" + args.join(", ") + ")"); | |
const result = originalMethod.apply(this, args); | |
console.log("=> " + result); | |
return result; |
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 | |
sudo apt-get update | |
sudo apt-get install \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
software-properties-common | |
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
{ | |
"name": "test", | |
"version": "1.0.0", | |
"lockfileVersion": 1, | |
"requires": true, | |
"dependencies": { | |
"@types/lodash": { | |
"version": "4.14.98", | |
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.98.tgz", | |
"integrity": "sha512-nVCBlQnsTw+769CM5Xt3jR/UAje48DLqEVQVtPLOILOR2AhCmZJ+LEefmbLVspm9U8YhNnT4afAtDsnIZpLogw==" |
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
license: MIT |
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
using System; | |
using UnityEngine; | |
public class PlayerPrefsDateTime { | |
public static DateTime GetDateTime(string key, DateTime defaultValue = default(DateTime)) { | |
if (PlayerPrefs.HasKey(key)) { | |
string stringValue = PlayerPrefs.GetString(key); | |
long longValue = Convert.ToInt64(stringValue); | |
return DateTime.FromBinary(longValue); | |
} |
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
// Iterate all folders inside resources/img/source/ | |
// Pack all images inside each folder with TexturePacker | |
// Put each individual spritesheet into resources/img/output (spritesheet name = folder name) | |
// Example: | |
// Source folders: resources/img/source/level1, resources/img/source/level2, resources/img/source/level3 ==> | |
// Output: resources/img/output/level1.json + png, resources/img/output/level2.json + png, resources/img/output/level3.json + png | |
const sh = require("shelljs"); | |
sh.pushd("resources/img/source/"); | |
sh.ls("-d", "*").forEach( |
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 %f in (card*.png) do magick frame.png %~nf.png -composite result/%~nf.png |
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
# Create multiple copies of the $file in the same directory | |
# For example: | |
# clonefile.ps1 test01.txt 3 --> test02.txt, test03.txt | |
# clonefile.ps1 test0.png 4 --> test1.png, test2.png, test3.png | |
param([string]$file, [int]$count) | |
if (-Not ($file -match "\d+") ) { | |
"File should contain starting number, for example image020.png" | |
exit; | |
} |
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
var path = require('path'); | |
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
colorizefla: { | |
blacknwhite: { | |
colors: [ | |
{name: "Color1", from: "#A8B89D", to: "#666666"}, | |
{name: "Color2", from: "#C2D1B6", to: "#999999"} | |
] |
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
declare var CocoonJS; | |
module hardware { | |
var backButtonHandler: () => void = null; | |
var backButtonDisplayObject: createjs.DisplayObject = null; | |
/** | |
* Call hardware.captureBackButton just before showing the screen, where you want to support "back" functionality, | |
* pass your own handler (typically screen onQuit handler). | |
* | |
* It assumes that only one screen is shown at a time. |