Skip to content

Instantly share code, notes, and snippets.

View felixmc's full-sized avatar

Felix Milea-Ciobanu felixmc

  • Facebook
  • Bay Area
View GitHub Profile
@felixmc
felixmc / routes.php
Last active December 29, 2015 19:19
<?php
/*
* Load controllers for setting up manual controller routes to allow for dynamic custom page routes
* */
$controllers = array();
foreach (scandir( APPPATH . "controllers" ) as $file) {
$fileParts = explode(".", $file);
if ($fileParts[1] === "php")
array_push($controllers, $fileParts[0]);
val cyan = new HSBColor(hue = 180, saturation = 65)
val bgColor: RGBColor = cyan
override def draw() {
background( bgColor )
stroke( new RGBColor(red = 255, green = 200, blue = 150) )
// draw something
}
Interpolation( start: Float, end: Float, duration: Float = 120f, fn: ( Float, Float, Float, Float ) => Float = Interpolation.linear,
repeat: Float = Float.PositiveInfinity, direction: Interpolation.Direction.Direction = Interpolation.Direction.Normal )
object RedFlashSketch extends ProcessingSketch {
val redInterpolation = new Interpolation( 0, 255, 60, Interpolation.easeInOutSine, Interpolation.Direction.Alternate )
override def draw() {
background( new RGBColor( red = redInterpolation.value, green = 0, blue = 0 ) )
redInterpolation.update
}
}
#!/usr/bin/env node
const path = require('path')
const exec = require('child_process').exec
const cmd = `ag "import .* from '" -G "${process.argv[2] || 'lib/'}" --nogroup | sed -e "s/:.*from//g" -e "s/'//g" | sed "s/^\\(.*\\.js\\) \\(.*\\)$/\\1 \\2/"`
exec(cmd, (error, stdout, stderr) => {
if (error) {
console.error('Error ocurred:', error)
} else {