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
#!/usr/bin/env python3 | |
"""JSON minify program. """ | |
import json # import json library | |
import sys # import sys library | |
def minify(file_name): | |
"Minify JSON" | |
file_data = open(file_name, "r", 1).read() # store file info in variable | |
json_data = json.loads(file_data) # store in json structure |
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
//============================================================================= | |
// RMMVNodeP1.js | |
//============================================================================= | |
/*: | |
* @author PluginDev | |
* @plugindesc A plugin to read and write files using Node.js | |
* | |
*/ | |
(function () { |
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
import flixel.util.FlxSignal; | |
// for signals that don't need data, use FlxSignal | |
var signal = new FlxSignal(); | |
// for signals that need data, use FlxTypedSignal with the correct function type | |
var stringSignal = new FlxTypedSignal<String->Void>(); | |
function noParamCallback() { | |
trace('Dispatched void event'); | |
} |
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
// A class; a template for creating objects with the properties listed in the class | |
class Duck { | |
public var age:Int; | |
public function new(age:Int) { | |
this.age = age; | |
} | |
} | |
class Test { |
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
//A class; a template for creating objects with the properties listed in the class | |
class Duck { | |
static public var CAN_FLY:Bool = true; | |
public var age:Int; | |
public function new(age:Int) { | |
this.age = age; | |
} | |
} |
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
//Test it out here: https://try.haxe.org/#5Fb7F1f4 | |
class Test { | |
public static function main() { | |
// Uncomment this and see what happens | |
// var firstUser:Person = { | |
// name: 'Tim' | |
// }; | |
// trace(firstUser.name); | |
var user:Test2 = { |
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
@:structInit class Person { | |
final name:String; | |
var age:Int = 30; | |
public function new(name:String, age:Int) { | |
this.name = name; | |
this.age = age; | |
} | |
public function greet() |
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
/** | |
* ADTs take in a parameter as you can see here. | |
*/ | |
enum ElementalAtk { | |
FireAtk(?dmg:Int); | |
WaterAtk(?dmg:Int); | |
LightningAtk(?dmg:Int); | |
MagnetoAtk(?dmg:Int); | |
IceAtk(?dmg:Int); |
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
/** | |
* ADTs take in a parameter as you can see here. | |
*/ | |
enum ElementalAtk { | |
FireAtk(?dmg:Int); | |
WaterAtk(?dmg:Int); | |
LightningAtk(?dmg:Int); | |
MagnetoAtk(?dmg:Int); | |
IceAtk(?dmg:Int); |
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
//============================================================================= | |
// PluginPattern.js | |
//============================================================================= | |
/*: | |
* | |
* @author Plugin Author Name | |
* @plugindesc The description of my plugin. | |
* |
NewerOlder