(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
/* --------------------------------------------------------------------------- | |
** This software is in the public domain, furnished "as is", without technical | |
** support, and with no warranty, express or implied, as to its usefulness for | |
** any purpose. | |
** | |
** main.cpp | |
** | |
** V4L2 RTSP streamer | |
** | |
** H264 capture using middleware_video |
#pragma config(Sensor, dgtl1, armEncoder, sensorQuadEncoder) | |
#pragma config(Motor, port1, armMotor, tmotorVex393_HBridge, openLoop) | |
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// | |
#pragma platform(VEX2) | |
#pragma competitionControl(Competition) | |
#include "Vex_Competition_Includes.c" | |
//****************************************************************************** | |
// 254_PID_Example.c |
find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion |
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"io" | |
"net" | |
"net/http" | |
"os" |
var script = document.createElement('script'); | |
script.src = 'https://rawgit.com/spite/ccapture.js/master/build/CCapture.all.min.js'; | |
script.addEventListener('load', function () { | |
// Create a capturer that exports a WebM video. | |
var capturer = new window.CCapture({format: 'webm'}); | |
var capture = window.capture = function (canvas) { | |
var render = function () { | |
requestAnimationFrame(render); | |
// Rendering stuff… | |
capturer.capture(canvas); |
Use this as an example on how to start the virtual console without the need of Java Web Start or accessing it from the web interface. | |
You can use the user and password that you use for the web interface. | |
You need an old JRE... I used 1.7.0_80 from the Server JRE package, also I have tested successfully 1.7.0_79 with MacOS. | |
You don't need to install it, just extract it or copy the files in "jre" folder. | |
Open the viewer.jnlp file that you get by launching the virtual console from the web interface with a text editor. | |
Note the urls to the jar files. Download the main jar file avctKVM.jar and the libs for your operating system and architecture. | |
Extract the dlls (.so Linux, .jnilib MacOS) from the jar libs. |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
from lxml import etree | |
#http://stackoverflow.com/a/34084933 | |
def get_deep_text(element): | |
try: | |
text = element.text or '' | |
for subelement in element: | |
text += get_deep_text(subelement) | |
text += element.tail or '' | |
return text |
<?php | |
/* | |
Use this just like `add_filter()`, and then run something that calls the filter (like | |
`new WP_Query`, maybe). | |
That's it. If the filter gets called again, your callback will not be. | |
This works around the common "filter sandwich" pattern where you have to remember to | |
call `remove_filter` again after your call. |
// http://stackoverflow.com/a/5727346/3774582 | |
// Parse CRON frequency | |
// Break it down like James Brown | |
function parse_crontab($time, $crontab) { | |
// Get current minute, hour, day, month, weekday | |
$time = explode(' ', date('i G j n w', strtotime($time))); | |
// Split crontab by space | |
$crontab = explode(' ', $crontab); | |
// Foreach part of crontab | |
foreach ($crontab as $k => &$v) { |