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
dapetcu21 / style-guide.md
Created Apr 27, 2018
Interrogation Style Guide
View style-guide.md

Lua style guide

Linting

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
dapetcu21 / synth.py
Created Mar 14, 2018
Raspberry Piano synth
View synth.py
#!/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
#
View lfa-modularization.md

#LFA Modularization

Impact

###CSS

  • 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.)

###JS

  • 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
dapetcu21 / bp_training.md
Last active Aug 29, 2015
British Parliamentary Training
View bp_training.md

British Parliamentary

Position nuances

OG OO CG CO
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
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] || '.');
View README.md

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
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.