Skip to content

Instantly share code, notes, and snippets.

View jasonsturges's full-sized avatar

Jason Sturges jasonsturges

View GitHub Profile
@jasonsturges
jasonsturges / scene.js
Created December 11, 2020 04:34
3D with Svelte and Three.js
import * as THREE from 'three';
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
const geometry = new THREE.BoxGeometry();
const material = new THREE.MeshBasicMaterial({ color: 0x00ff00 });
const cube = new THREE.Mesh(geometry, material);
let renderer;
scene.add(cube);
camera.position.z = 5;
@jasonsturges
jasonsturges / global.css
Created December 11, 2020 05:28
3D with Svelte and Three.js
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0
}
@jasonsturges
jasonsturges / App.svelte
Created December 11, 2020 19:24
3D with Svelte and Three.js
<script>
import { onMount } from 'svelte';
import { createScene } from "./scene";
let el;
onMount(() => {
createScene(el)
});
</script>
@jasonsturges
jasonsturges / App.svelte
Created December 11, 2020 20:21
3D with Svelte and Babylon.js
<script>
import { onMount } from 'svelte';
import { createScene } from "./scene";
let el;
onMount(() => {
createScene(el)
});
</script>
@jasonsturges
jasonsturges / noiseWithSmoothness.swift
Last active December 26, 2020 23:02
SpriteKit Procedurally Generated Noise
let noiseTexture = SKTexture(noiseWithSmoothness: 1.1,
size: CGSize(width: 1024, height: 768),
grayscale: false)
let noiseSprite = SKSpriteNode(texture: noiseTexture)
@jasonsturges
jasonsturges / Button.stories.js
Last active January 28, 2021 04:54
Storybook with React, Redux, and Material UI
import React from 'react';
import { Button } from './Button';
export default {
title: 'Example/Button',
argTypes: {
backgroundColor: { control: 'color' },
primary: { control: "boolean" },
label: { control: "text" },
@jasonsturges
jasonsturges / output.md
Last active March 4, 2021 17:23
Drop Decimal Test Suite
double not operator
    min: 6.25000    avg: 8.41969    max: 11.04000    ops/second: 123,911,231

or operator
    min: 7.30000    avg: 9.52969    max: 10.75000    ops/second: 107,329,250

signed right shift operator
    min: 7.07500    avg: 10.00412   max: 10.79500    ops/second: 101,645,033
@jasonsturges
jasonsturges / .gitignore
Last active May 14, 2021 07:00
Creating a TypeScript NPM Package
node_modules
build
dist
docs
@jasonsturges
jasonsturges / ApplicationDbContext.cs
Created June 10, 2021 15:40
ASP.NET Core with MySQL
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
public class ApplicationDbContext : IdentityDbContext
{
// ...
protected override void OnModelCreating(ModelBuilder builder)
@jasonsturges
jasonsturges / Eurostile.fnt
Last active March 26, 2022 20:29
Eurostile Bitmap Font Glyphs
<?xml version='1.0'?>
<font>
<info aa='1' size='180' smooth='1' stretchH='100' bold='0' padding='0,0,0,0' spacing='0,0' charset='' italic='0' unicode='0' face='Eurostile'/>
<common scaleW='1216' packed='0' pages='1' lineHeight='180' scaleH='1152' base='121'/>
<pages>
<page id='0' file='Eurostile.png'/>
</pages>
<chars count='95'>
<char xadvance='45' x='1160' chnl='0' yoffset='121' y='118' xoffset='0' id='32' page='0' height='0' width='0'/>
<char xadvance='56' x='158' chnl='0' yoffset='-1' y='580' xoffset='14' id='33' page='0' height='124' width='32'/>