Skip to content

Instantly share code, notes, and snippets.

Avatar

Mandi Burley (Grant) MJGrant

View GitHub Profile
View link-checker-test.html
View reply_filtering.tsx
let allPosts = [ {id: 123, name: "test post 1"},
{id: 456, name: "test post 2"}
];
let allReplies = [ {id: 1, replyTo: 123, name: 'reply 1', read: false},
{id: 2, replyTo: 123, name: 'reply 2', read: false},
{id: 3, replyTo: 456, name: 'reply 3', read: false}
];
// simulate a server response with 1s wait time
const getRepliesToPost = async (id: number) => {
View main.dart
// Closure example, sort of a companion to my JS example:
// https://repl.it/@MandiGrant/JSClosureExample
// combineNames is a function that returns a function.
var combineNames = (firstName) {
return (lastName) => firstName + ' ' + lastName;
};
/* If you call it like this,
@MJGrant
MJGrant / main.dart
Created Feb 18, 2020
Simple closure in Dart
View main.dart
// Closure example, sort of a companion to my JS example:
// https://repl.it/@MandiGrant/JSClosureExample
// combineNames is a function that returns a function.
var combineNames = (firstName) {
return (lastName) => firstName + ' ' + lastName;
};
void main() {
// Call it with a first name and then call *that* function with a last name
View amazin-product-box-css-example-1.css
.amazin-product-box {
background-color:#ffffff;
color:#181c1a;
}
.amazin-product-box h3 {
margin:16px 0px;
}
View amazin-featured-box-css-example-2.css
View amazin-featured-box-css-example-1.css
View better-cars.txt
group: auto_dealer_schema
Model = {
model_id:number, model_name:string, first_production_year:string
1,'XJS','1987'
2,'XK120','1948'
3,'Camaro','1966'
4,'GT','2005'
5,'Boss 302 Mustang','1969'
6,'P1800','1961'
@MJGrant
MJGrant / parsely.js
Created Dec 17, 2018
node js project that builds static data files for my Godot project
View parsely.js
/* Parsely v.0.1
Developed for Guild Leader project (December 2018)
To use: place .json files in parsely/names, parsely/staticData, parsely/timedNodeData, etc.
In Terminal:
node parsely.js
Exported .gd files are placed directly in gameData folder.
@MJGrant
MJGrant / createHero1.gd
Created Dec 17, 2018
Create a hero and add it to the scene
View createHero1.gd
#the new hero is the last thing in the roster, so grab it out of the back
var lastIndex = global.guildRoster.size() - 1
global.selectedHero = global.guildRoster[lastIndex]
var heroScene = preload("res://hero.tscn").instance()
heroScene.set_instance_data(global.selectedHero)
heroScene._draw_sprites()
heroScene.set_position(Vector2(240, 80)) #screen is 540 wide
heroScene.set_display_params(false, true) #walking enabled?, show name
add_child(heroScene)