Skip to content

Instantly share code, notes, and snippets.

View jsscclr's full-sized avatar
🐈

Jessica Claire Edwards jsscclr

🐈
  • Sydney, Australia
View GitHub Profile
@jackrugile
jackrugile / calc.js
Last active January 8, 2019 15:38
Some common calculation helpers I use in a lot of my demos and games.
class Calc {
/*
------------------------------------------
| rand:float - returns random float
|
| min:number - minimum value
| max:number - maximum value
|
| Get a random float between two values

Strings

String.prototype.*

None of the string methods modify this – they always return fresh strings.

  • charAt(pos: number): string ES1

    Returns the character at index pos, as a string (JavaScript does not have a datatype for characters). str[i] is equivalent to str.charAt(i) and more concise (caveat: may not work on old engines).

@ebidel
ebidel / coverage.js
Last active April 27, 2024 04:13
CSS/JS code coverage during lifecycle of page load
Moved to https://github.com/ebidel/puppeteer-examples
@reiver-dev
reiver-dev / fira_code_patch.py
Created February 5, 2018 03:07
Move ligatures for Fira Code font to private unicode area at U+e100
import os
import sys
import argparse
from glob import glob
from itertools import chain
import fontforge
ADDITIONAL_LIGATURES = [
'x.multiply',

In this tutorial we're going to build a set of parser combinators.

What is a parser combinator?

We'll answer the above question in 2 steps.

  1. What is a parser?
  2. and, what is a parser combinator?

So first question: What is parser?

texture loading

A utility for loading texture in ThreeJS. Will upload to GPU as soon as the texture is loaded, ensuring that it won't cause jank later in your application.

Example:

const loadTexture = require('./loadTexture');

// Returns a THREE.Texture object
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active May 23, 2024 15:25
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@prathik
prathik / todo.el
Last active September 27, 2020 05:27
Manage daily todo files on Emacs
(defun todo-create-directory (directory)
"Creates the todo directory."
(if (file-exists-p directory) (message "Directory exists")
(make-directory directory)
(message "Directory created")
))
(defun create-todo-file (directory filename)
"Checks if the todo file exists if not creates it."
(todo-create-directory directory)
@joeporpeglia
joeporpeglia / Counter.jsx
Created September 22, 2017 15:31
Redux as a Render Prop
import StoreProvider from './StoreProvider';
const increment = { type: '@counter/increment' };
const decrement = { type: '@counter/decrement' };
const initialState = { count: 0 };
const reducer = (state = initialState, action) => {
switch (action.type) {
case increment.type: