Skip to content

Instantly share code, notes, and snippets.

View Frencil's full-sized avatar

Christoph Clark Frencil

View GitHub Profile
@Frencil
Frencil / Theme.js
Created July 16, 2019 16:51
NEON Portal Material UI Theme
import 'typeface-source-sans-pro';
import { createMuiTheme, responsiveFontSizes } from '@material-ui/core/styles';
// Values defined here are based on the NEON Style Guide.
// See all customizable Material UI theme keys here:
// https://material-ui.com/customization/default-theme/#explore
const PALETTES = {
PRIMARY: {
@Frencil
Frencil / tween_pp3s.py
Created June 20, 2017 03:54
Drop-in python script to linearly tween numeric values in processing profiles across a set of arbitrarily many RAW images
#!/usr/bin/python
import string, os
START_FILE_PATH = "start.pp3"
END_FILE_PATH = "end.pp3"
RAW_FILES_DIR = "raw"
# Load the contents of the start and end PP3 files (equal line numbers enforced!)
@Frencil
Frencil / solutions.cpp
Created February 23, 2016 16:17
Candidate solutions sent after the fact
int solution(std::vector<int> &A, std::vector<int> &B)
{
std::map<int, int> disjoints;
for (std::size_t i = 0; i < A.size(); ++i)
{
auto it = disjoints.lower_bound(B[i]);
if (it == disjoints.end())
{
disjoints.emplace(A[i], B[i]);
@Frencil
Frencil / r_pretty.js
Created December 18, 2015 18:04
Implementation of R's pretty function in Javascript
/**
* Generate a "pretty" set of ticks (multiples of 1, 2, or 5 on the same order of magnitude for the range)
* Based on R's "pretty" function:
* https://github.com/wch/r-source/blob/b156e3a711967f58131e23c1b1dc1ea90e2f0c43/src/appl/pretty.c
* Arguments:
* range (required) :: Two-element array representing the range for the ticks to cover
* n (optional) :: A "target" number of ticks; will not necessarily be the number of ticks you get (default: 5)
* internal_only (optional) :: Boolean for whether to only return ticks inside the provided range (default: false)
*/
function pretty(range, n, internal_only){
@Frencil
Frencil / videostacker
Created April 1, 2015 03:15
Python video stacker
import os, sys, numpy, PIL
from PIL import Image
# Build list of source video clips from arguments
clips = []
for i in range(1,len(sys.argv),2):
path = sys.argv[i]
offset = sys.argv[i+1]
filename, ext = path.split('.')
clip = { 'path': path,
@Frencil
Frencil / zelda_frog.pde
Created February 12, 2012 03:02
Arduino Sketch - Lilypad/Plushbot Zelda Frog
/*
* PlushBot/Lilypad Zelda Frog
*
* Basic Lilypad circuit with a light sensor, a piezo, and some LEDs.
* This is a modified version of the example sketch that just played the scale.
* Now it plays the ending theme from the original Legend of Zelda, complete with a bass line.
*
* Video of the complete circuit (but half-finished PlushBot) in action:
* http://www.youtube.com/watch?v=JyAL9HSyIVM
*/