Skip to content

Instantly share code, notes, and snippets.

View NathanFlurry's full-sized avatar
🔩
Riveting

Nathan Flurry NathanFlurry

🔩
Riveting
View GitHub Profile
@NathanFlurry
NathanFlurry / 3D StackIt Prototype
Created October 7, 2013 00:45
Today, I wanted to learn in depth how to use the 3D aspect of Codea, so I embarked on making a simple 3D prototype of my game StackIt. Please note, there's tons of bugs, but I needed to keep working on the actual StackIt, so I stopped the development there.
--# Main
displayMode(FULLSCREEN)
supportedOrientations(PORTRAIT_ANY)
function setup()
bg = getGradient(vec2(WIDTH,HEIGHT),color(0,90,255),color(50,190,255))
Game:init()
end
@NathanFlurry
NathanFlurry / Main.lua
Created December 16, 2013 01:36
December 2013 Ludum Dare entry.
--# Main
displayMode(FULLSCREEN_NO_BUTTONS)
function setup()
parameter.boolean("rotateCamera",true)
lastScore = readLocalData("lastScore",0)
highscore = readLocalData("highscore",0)
StateMachine:init()
@NathanFlurry
NathanFlurry / Main.lua
Created December 24, 2013 02:53
Shatter a mesh into physical triangles
--# Main
function setup()
m = mesh()
m.visible = true
fragments = {}
parameter.number("meshScale",10,400,150)
@NathanFlurry
NathanFlurry / Main.lua
Created December 31, 2013 09:08
Entry for the 2013 Codea Holiday Codea Cook Off Competition.
--# Main
displayMode(FULLSCREEN_NO_BUTTONS)
supportedOrientations(LANDSCAPE_ANY)
function setup()
AssetLoader:init(
{
KAStar = "star.png",
KAPuff = "puff.png",
Math.lerp = function(a,b,f) {
return Number(a) + f * (Number(b) - Number(a));
}
Math.radians = function(degrees) {
return degrees * Math.PI / 180;
};
Math.degrees = function(radians) {
return radians * 180 / Math.PI;
@NathanFlurry
NathanFlurry / ExampleCode.lua
Created May 24, 2014 18:10
You also need to have https://github.com/Zoyt/EasyiAP included in your project.
-- In setup
iapItems = {}
registerItem("itemIDOne")
registerItem("itemIDTwo")
initStore()
storeReady = false
purchasePending = false
-- Purchasing the item
purchaseItem(itemNum) -- Number of the item registered in order; i.e. 0 would be 'itemIDOne' and 1 would be 'itemIDTwo'
@NathanFlurry
NathanFlurry / ClassifiedTokenAuthenticationMiddleware.swift
Created May 26, 2017 07:39
Like `TokenAuthenticationMiddleware`, but can declare a private and public token for a single object.
import Fluent
import Authentication
/// Copy of `TokenAuthenticationMiddleware` middleware that uses classified tokens. This way, objects can use
/// private and public tokens.
public final class ClassifiedTokenAuthenticationMiddleware<U: TokenAuthenticatable>: Middleware {
public let isPrivate: Bool
public init(_ userType: U.Type = U.self, isPrivate: Bool) {
self.isPrivate = isPrivate
@NathanFlurry
NathanFlurry / README.md
Last active February 13, 2023 20:58
Inkdrop Import Markdown Files

About

This script will import Markdown files from a folder. It will only import files ending in .md, so it skips folders and images. This will use the file name as the note name. If there is a H1 on the first line, it will remove that line and trim the file in order to remove redundancy.

How to use

  1. Select the notebook you want to import into in the sidebar.
  2. Under Inkdrop, select Developer > Toggle Developer Tools.
  3. Paste this script.
  4. Replace path/to/folder/with/markdown/files/ with a path to the folder with the markdown files in it. Make sure to include the trailing "/".
  5. Ignore the error and please forgive my laziness. If you get a grey screen, just click a few times and the ghost windows will disappear.