Skip to content

Instantly share code, notes, and snippets.

View rasteiner's full-sized avatar

Roman Steiner rasteiner

  • Toast Communication Lab
  • Switzerland
View GitHub Profile
@rasteiner
rasteiner / gist:ae09bf8ef9fff3ea7c64
Last active June 17, 2016 16:53
Wavepot - semplicissimo player di melodie (senza ritmo)
/*!
* Vai su: http://wavepot.com/
* Modifica la melodia qui sotto:
*/
var bpm = 120;
var melodia = 'do do sol sol la la sol fa fa mi mi re re do ';
var basso = 'do do sol sol la la sol fa fa mi mi re re do ';
@rasteiner
rasteiner / transform.js
Last active August 29, 2015 14:10
transform Three.js sourcecode tu use relative path require() statements
var glob = require('glob');
var mkdirp = require('mkdirp');
var falafel = require('falafel');
var fs = require('fs');
var colors = require('colors');
var Q = require('q');
var path = require('path');
function searchDefs(src) {
var defs = [];
@rasteiner
rasteiner / index.js
Last active August 29, 2015 14:10
requirebin sketch
//start 0,0,0
var width = 8;
var radius = 2;
var segments = 8;
var half = width / 2;
var segmentStepSize = Math.PI / 2 / segments;
//displacement
var w = half-radius;
@rasteiner
rasteiner / key_mac.pub
Last active August 29, 2015 14:19
add my public key to your authorized hosts.
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0JCmGBzKdsused0xlCcTfJEFQl02q44UB37+Uu1yBGarnxYINaJ3OxG6Zysvtiuh4u7gpS7+OOsVKeMyNXcZqRPDINFaZXgCYSkA9t5d/RwSVnNLVZeb1oiaRrmtko3dG+TXkDergjV9Lxbnt4T2I3HPrI8bxfwBzZaj782EUjX7WiylPM+K+jaOVBMPQLifIyvD/GazP0hhQmpBXz6vNCHg5VzWZWKgIGdEqexihU3ysvhvB2xVRGuJ1wPGBQfEpdRJs1qjDK5cgTJWovNbtQs28786YjhYVlo6lVy1i8FJLX3P0J4BE2X1S9kKIdqO0s8nCVCXRmGW1beclzzlL roman@romac.local
/// illustrator script stub - converts paths to ... something else
var items = app.activeDocument.pageItems;
var strlog = '';
var ops = [];
function log(str) {
strlog+= "\n" + str;
}
@rasteiner
rasteiner / emojis.php
Last active July 18, 2018 13:15
create an emoji detecting regex
<?php
$data = explode("\n", file_get_contents('https://unicode.org/Public/emoji/11.0/emoji-data.txt'));
$ranges = [];
$toint = function($str) {
return intval($str, 16);
};
foreach ($data as $line) {
$line = trim(preg_replace('/[#;].*/', '', $line));
function APACHE {
docker run -d --rm -p 80:80 -v "${PWD}:/var/www/html" rasteiner/phpapache-for-devs
}
function APACHE7 {
docker run -d --rm -p 80:80 --env XDEBUG_CONFIG="remote_enable=0 profiler_enable=0" -v "${PWD}:/var/www/html" rasteiner/phpapache-for-devs:php7
}
function APACHE7-DEBUG {
$HostIP = ( `
@rasteiner
rasteiner / index.php
Created May 14, 2019 16:51
fields shortcut
<?php
use Kirby\Cms\PageBlueprint;
class shortcutsPreset {
static private $counter = 0;
static private function randomSectionName() {
self::$counter += 1;
return 'shortcuts_preset_section_' . self::$counter;
}
@rasteiner
rasteiner / .stubs.php
Created August 14, 2021 16:03
Stubs for Kirby 3 aliased classes
<?php
/**
* @copyright Copyright (c) 2021 Bastian Allgeier
* @author Bastian Allgeier
* @link http://getkirby.com/
* @license http://getkirby.com/license/
*/
/**
* Anything in your public path can be converted
@rasteiner
rasteiner / schema.json
Created January 31, 2022 14:44
Kirby page blueprint schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "getkirby.com/schema/v3/blueprints/page",
"type": "object",
"$defs": {
"tabs": {
"type": "object",
"description": "Tabs are used to group related content. They can be used to create a tabbed navigation.",
"additionalProperties": {
"$ref": "#/$defs/tab"