Skip to content

Instantly share code, notes, and snippets.

View ddmills's full-sized avatar
🐴
lets get some shoes

Dalton Mills ddmills

🐴
lets get some shoes
View GitHub Profile
@ddmills
ddmills / astar.rs
Created March 14, 2024 03:14
Generic A* for rust
// a generic astar implementation
// PriorityQueue<T> is just a binary heap queue
pub struct AStarSettings<T, H, C, N, G>
where
T: std::cmp::Eq + std::hash::Hash + Copy,
H: Fn(T) -> f32,
C: Fn(T, T) -> f32,
N: Fn(T) -> Vec<T>,
G: Fn(T) -> bool,
@ddmills
ddmills / cp437-to-fnt.js
Last active August 16, 2022 19:05
Convert cp437 bitmap to fnt format
var valid = [" ", "!", "&quot;", "#", "$", "%", "&amp;", "'", "(", ")", "*", "+", ",", "-", ".", "/", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "&lt;", "=", ">", "?", "@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "\\", "]", "^", "_", "`", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "{", "|", "}", "~", "¡", "¢", "£", "¤", "¥", "¦", "§", "¨", "©", "ª", "«", "¬", "­", "®", "¯", "°", "±", "²", "³", "´", "µ", "¶", "·", "¸", "¹", "º", "»", "¼", "½", "¾", "¿", "À", "Á", "Â", "Ã", "Ä", "Å", "Æ", "Ç", "È", "É", "Ê", "Ë", "Ì", "Í", "Î", "Ï", "Ð", "Ñ", "Ò", "Ó", "Ô", "Õ", "Ö", "×", "Ø", "Ù", "Ú", "Û", "Ü", "Ý", "Þ", "ß", "à", "á", "â", "ã", "ä", "å", "æ", "ç", "è", "é", "ê", "ë", "ì", "í", "î", "ï", "ð", "ñ", "ò", "ó", "ô", "õ", "ö", "÷", "ø", "ù", "ú", "û", "ü", "ý", "þ", "ÿ", "Ÿ"];
var mapping =[
['NUL', '☺', '☻', '♥',
@ddmills
ddmills / emoji.md
Last active July 5, 2017 02:49 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
function foo() {
for (var i = 0; i < 10; i++) {
try {
return i;
} finally {
continue;
}
}
return i;
}
@ddmills
ddmills / geotic.js
Created July 20, 2016 03:33
Component-Entity-System
let _id;
const id = () => {
let now = Date.now();
if (now <= _id) now++;
_id = now;
return now;
}
const hash = (n) => n.sort((a, b) => a > b).join('$');
const remove = (a, v) => a.splice(a.indexOf(v), 1);
@ddmills
ddmills / laravel-nginx-site
Created February 21, 2016 15:29
nginx web server configuration for laravel. Being used on an AWS EC2 instance with ubuntu 14.04. Note that Rocketeer is being used for deployment/CI.
server {
# Port that the web server will listen on.
listen 80;
# Host that will serve this project.
server_name my-project.local;
access_log /var/www/my-project/log/access.log;
error_log /var/www/my-project/log/error.log;
/*
* NodeJS driver for MongoDB
*
* This is from the https://docs.mongodb.org/getting-started/node/client/ documentation.
* Expects database on mongodb://localhost:27017/test
*/
var MongoClient = require('mongodb').MongoClient;
var assert = require('assert');
var url = 'mongodb://localhost:27017/test';
@ddmills
ddmills / gulpfile.js
Created December 14, 2015 03:18
gulp + babel + browserify
'use strict';
var
gutil = require('gulp-util'),
gulp = require('gulp'),
browserify = require('browserify'),
babelify = require('babelify'),
source = require('vinyl-source-stream'),
buffer = require('vinyl-buffer'),
browser = require('browser-sync'),
import org.paninij.lang.*;
@Capsule
public class ConsoleTemplate {
@Block
public void write(String s) {
System.out.println(s);
}
}