Skip to content

Instantly share code, notes, and snippets.

View Galadirith's full-sized avatar

Edward Fauchon-Jones Galadirith

View GitHub Profile
@Galadirith
Galadirith / script.js
Last active June 15, 2020 10:44
dev.to light syntax colour for code snippets in articles, the editor, and article comments
function add_css(rule) {
let css = document.createElement('style');
css.type = 'text/css';
css.appendChild(document.createTextNode(rule));
document.getElementsByTagName("head")[0].appendChild(css);
}
let rule = '.container .body pre, .crayons-article__body pre, div.inner-comment div.body div.highlight pre.highlight {background: hsla(240, 6%, 4%, 1); filter: invert(1);}';
rule += '.container .body pre code, .crayons-article__body pre code {background: hsla(240, 6%, 4%, 1);}';
add_css(rule)
@Galadirith
Galadirith / bonus.html
Created April 21, 2020 16:46 — forked from BlueMagnificent/bonus.html
Javascript 3D Physics Tut 2 Bonus
<html>
<head>
<meta charset="utf-8">
<title>Move JS 3D Physics</title>
<style>
body { margin: 0; }
</style>
</head>
<body>
@Galadirith
Galadirith / tetris.py
Created January 28, 2020 20:40 — forked from silvasur/tetris.py
Tetris implementation in Python
#!/usr/bin/env python2
#-*- coding: utf-8 -*-
# NOTE FOR WINDOWS USERS:
# You can download a "exefied" version of this game at:
# http://hi-im.laria.me/progs/tetris_py_exefied.zip
# If a DLL is missing or something like this, write an E-Mail ([email protected])
# or leave a comment on this gist.
# Very simple tetris implementation
@Galadirith
Galadirith / index.html
Created October 3, 2019 21:41 — forked from cecilemuller/index.html
Record three.js to WebM video using CCapture.js
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Record WebGL to WebM (Chrome only)</title>
<meta charset="utf-8">
<link rel="stylesheet" href="styles.css" charset="utf-8">
</head>
<body>
<div class="buttons">
@Galadirith
Galadirith / ffmpeg-web-video-guide.md
Created February 16, 2019 18:20 — forked from jaydenseric/ffmpeg-web-video-guide.md
A quick guide to using FFmpeg to create cross-device web videos.

Video conversion with FFmpeg

Install

On mac:

  1. Download the latest release.
  2. Extract the binary and place it in /usr/local/bin.

Command basics

@Galadirith
Galadirith / license-badges.md
Created February 3, 2019 18:47 — forked from lukas-h/license-badges.md
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

@Galadirith
Galadirith / gist:725bcceba573a0bcf87334aed4039868
Created October 21, 2018 10:50 — forked from lmccart/gist:2273a047874939ad8ad1
p5.js + p5.dom.js + clmtracker.js
<html>
<head>
<script src="clmtrackr.js"></script>
<script src="model_pca_20_svm.js"></script>
<script src="p5.js"></script>
<script src="p5.dom.js"></script>
<script>
var ctracker;
@Galadirith
Galadirith / BezierLeastSquaresFit.ipynb
Created December 28, 2017 14:02 — forked from anonymous/BezierLeastSquaresFit.ipynb
Use least squares to find the cubic bezier equation of a hand drawn arc. This ipython notebook uses sympy to derive the equations needed to setup the least squares fitting problem. It then creates some noisy data on an arc and shows that the best fitting process works quite well.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Galadirith
Galadirith / index.html
Created October 3, 2017 03:15
path-maker-d
<div class="container">
</div>
@Galadirith
Galadirith / index.html
Created July 16, 2017 20:25
SVG filter 8
<!-- Learn about this code on MDN: https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Gradients -->
<svg
width="400"
height="500"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<!--