Skip to content

Instantly share code, notes, and snippets.

View suppayami's full-sized avatar
🙀

Cuong Nguyen suppayami

🙀
View GitHub Profile
{
"name" : "Forest Night",
"cursorColor": "#FFFFFF",
"selectionBackground": "#FFFFFF",
"background" : "#323d43",
"foreground" : "#d8caac",
"black" : "#465258",
@suppayami
suppayami / cloudSettings
Last active May 5, 2020 20:49
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-05-05T20:49:57.407Z","extensionVersion":"v3.4.3"}
function OpenLuna() {
let gui = require("nw.gui");
var configWindow = gui.Window.open('./Tools/index.html');
var window = gui.Window.get();
configWindow.on("loaded", function() {
configWindow.window.parent = window;
});
}
Example.prototype.newMethod = function(): void {
let that: Example = this;
// use that instead of this from here.
console.log(that.newProperty);
};
class Example {}
interface Example {
newMethod(): void;
newProperty: string;
}
Example.prototype.newMethod = function(): void {};
Example.prototype.newProperty = "New Property";
class Example {}
Example.prototype.newMethod = function(): void {};
puts "\nTranslated:\n" + ARGV.map { |a| a =~ /\w+/i ? a + "'s" : a }.join(" ")
@suppayami
suppayami / 0_reuse_code.js
Created November 11, 2015 15:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@suppayami
suppayami / LunaConditionAndEvalProperties.md
Last active November 4, 2015 15:35
Some useful conditions and eval properties for Luna Lite

Conditions

I only list all custom conditions I have added and some other useful conditions.

this.isSelectingActor()
Return true when related actor with GUI element is being selected.

this.isSelectingEnemy()
Return true when choosing enemy targets.

this.isSelectingAction()

@suppayami
suppayami / sqrt.rb
Created December 4, 2014 18:32
Find square root with Newton's Method
def sqrtNewton(x, d)
# guess start, find the closest value to the root
# fastest way to do with code, we can minus x by 1 and check if
# its square root is integer.
xr = Math.sqrt(x).floor.to_f
puts sprintf("x0 = %.#{d}f", xr)
# initialize delta, the init value is not important
delta = 100