Skip to content

Instantly share code, notes, and snippets.

Marius Petcu dapetcu21

Block or report user

Report or block dapetcu21

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
dapetcu21 /
Created Apr 27, 2018
Interrogation Style Guide

Lua style guide


This project makes use of [Luacheck] for catching common mistakes. Install it and configure it for your text editor.

Editor configuration

We recommend [Atom] for editing Lua code along with the following packages:

  • [linter-luacheck]: [Luacheck] integration
dapetcu21 /
Created Mar 14, 2018
Raspberry Piano synth
#!/usr/bin/env python
import RPi.GPIO as GPIO
import time
import subprocess
from os import path
from os import listdir
import sys
import threading
View hs_err_pid30047.log
# A fatal error has been detected by the Java Runtime Environment:
# SIGSEGV (0xb) at pc=0x0000000134de8132, pid=30047, tid=0x0000000000000307
# JRE version: Java(TM) SE Runtime Environment (8.0_102-b14) (build 1.8.0_102-b14)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.102-b14 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C 0x0000000134de8132

#LFA Modularization



  • We'll have to separate Stylus execution contexts even further, taking it from a vendor/user unified model to a per-module model. This will certainly be much cleaner and faster, but it will have the downside of the userland not being able to override Stylus variables from the core or from lfa-classroom and vice-versa. We weren't doing this too much anyway and were overriding CSS rules instead, so I guess this is fine. This translates to the disappearance of config.styl.
  • This new level of separation can open the path to very easy support for other CSS precompilers (SASS, LESS, etc.)


  • No more require('lfa-classroom/view/NameView'). Modules will have to explicitly export functionality. require('lfa-classroom').NameView Again, this might actually be a tad cleaner.
dapetcu21 /
Last active Aug 29, 2015
British Parliamentary Training

British Parliamentary

Position nuances

Strategy Good setup. Preemptive rebuttal Fine line between rebuttal and constructive Clear cut. Destroy OO Destroy everything
Extension Carpet-bombing Carpet-bombing Most important point, but deeply developed Interweaved with counterarg
POI Strategy Bring attention to your case OG: Destroy. CG: Bring attention to case Don't reveal your extension. OO: Draw blood. CO: Clash strongly Hook
View Thread.js
var child_process = require('child_process');
var fs = require('fs');
var JSONStream = require('JSONStream');
var Thread = {};
// Run this to fork a child process that quits when the parent quits
Thread.fork = function fork(moduleName, opts) {
opts = opts || {};
opts.silent = opts.silent || false;
dapetcu21 / convert.js
Last active Aug 29, 2015
LFA 0.5 -> 0.6 format conversion tool
View convert.js
#!/usr/bin/env node
var path = require('path');
var yaml = require('js-yaml');
var fs = require('fs');
var filewalker = require('filewalker');
var nodefn = require('when/node');
var _ = require('lodash');
var project = path.resolve(process.argv[2] || '.');

Build Status

Orchestrator-like task management with event stream integration.

Gulp advocates the philosophy that disk I/O should be kept to the minimum: the initial read and the final write. To this end, it popularized event streams and the stream piping pattern.

Unfortunately, orchestrator is blatantly stream-unaware. A .pipe() chain can only be contained to one orchestrator task and in most complex gulpfiles, you end up with either huge or function-fragmented tasks, either tasks that write temporary files (or to global variables).

Affluent tries to solve this issue by treating tasks as streams. Tasks can be run in sequence with access to the previous tasks' output and merged. Also, tasks don't have to wait for their dependencies to finish their whole .pipe() chain, as they can add themselves

dapetcu21 / routes.geojson
Last active Aug 29, 2015
Routes for Delta
View routes.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.