Skip to content

Instantly share code, notes, and snippets.

{
"__header__": {
"fileType": "LDtk Project JSON",
"app": "LDtk",
"doc": "https://ldtk.io/json",
"schema": "https://ldtk.io/files/JSON_SCHEMA.json",
"appAuthor": "Sebastien 'deepnight' Benard",
"appVersion": "1.1.3",
"url": "https://ldtk.io"
},
@agmcleod
agmcleod / gist:942871
Created April 26, 2011 19:04
jquery.autocomplete.js
/*
* Autocomplete - jQuery plugin 1.1pre
*
* Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Revision: $Id: jquery.autocomplete.js 5785 2008-07-12 10:37:33Z joern.zaefferer $
@agmcleod
agmcleod / nestjs-notes.md
Created March 10, 2022 16:58
NestJS notes

NestJS

For getting started with NestJS I highly recommend looking over the official documentation. The overview section & fundamentals covers a lot of great information as to how one builds a backend application with NestJS. https://docs.nestjs.com/first-steps.

It will also cover adding dependencies for various features like configuration, typeorm, graphql via apollo, etc.

When setting up the project via nest new <project-name> it will create a starting project, along with git repository. If your git is configured to have the default branch of master, be sure to change the branch of the nest project to something more inclusive like main or dev. Also be sure to update your git configuration to use this by default

git config --global init.defaultBranch main

class ApplicationController < ActionController::Base
protect_from_forgery
force_ssl
helper_method :current_shop, :shopify_session
protected
def current_shop
@current_shop ||= Shop.find(session[:shop_id]) if session[:shop_id].present?
end
use debug_gfx::draw_nav_mesh;
use std::fs::File;
use std::io::prelude::*;
use std::io::Result;
mod debug_gfx;
fn read_file(path: &str) -> Result<String> {
let mut text = String::new();
let mut file = File::open(path)?;
{
"openapi" : "3.0.0",
"info" : {
"title" : "Simple Inventory API",
"description" : "This is a simple API",
"contact" : {
"email" : "you@your-company.com"
},
"license" : {
"name" : "Apache 2.0",
@agmcleod
agmcleod / App.css
Created November 22, 2019 21:02
This can be tested via create react app.
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
}
.App-header {
background-color: #282c34;
@agmcleod
agmcleod / home_spec.rb
Created February 28, 2012 05:07
shopify api integration testing
require 'spec_helper'
describe "home" do
before do
@domain = "myshop.myshopify.com"
@token = SecureRandom.hex(16)
@shopify_session = ShopifyAPI::Session.new(@domain, @token)
end
@agmcleod
agmcleod / state.rs
Created June 30, 2018 14:31
State management rust, snippet
pub mod play_state;
use std::sync::{Arc, Mutex};
use specs::World;
use std::collections::HashMap;
use scene::Node;
use conrod::backend::gfx::Renderer;
@agmcleod
agmcleod / melonjs-ecs.md
Last active April 10, 2017 02:14
MelonJS ECS Proposal

Melonjs ECS proposal

After working with unity a fair bit, I've come to appreciate the modular code base. Components have an expected api, and provide a single thing to the parent object or entity.

The problems with the current setup.

  • It can be hard to know what objects you need. Renderable/Sprite/Animation Sheet
  • Entity is the only thing that has physics, defaults to an animation sheet.
  • Sprite is the only thing that provides scale and rotation, plus subclasses