Skip to content

Instantly share code, notes, and snippets.

View Narven's full-sized avatar
👾
Walking to the fridge...

Pedro Luz Narven

👾
Walking to the fridge...
View GitHub Profile
@Narven
Narven / react-confirm.js
Created December 22, 2019 13:22 — forked from primaryobjects/react-confirm.js
A simple example of a confirm alert dialog in ReactJs / React.
<div className='delete-button' onClick={() => { if (window.confirm('Are you sure you wish to delete this item?')) this.onCancel(item) } } />
@Narven
Narven / get_dates.php
Created November 9, 2019 23:50 — forked from Jayaramki/get_dates.php
Get All Dates in given month and year in php
/*Get All Dates in given month and year in php by CJ Ramki (http://cj-ramki.blogspot.in)*/
function get_dates($month,$year){
$numbers = array('1','2','3','4','5','6','7','8','9');
$datesArray = array();
$num_of_days = date('t',mktime (0,0,0,$month,1,$year));
for( $i=1; $i<= $num_of_days; $i++) {
if(in_array($i,$numbers)) $i = '0'.$i;
//complete date in Y-m-d format
@Narven
Narven / gist:20ea71ee9d0c40c72c7b428a4b6a3bbb
Created October 1, 2019 22:46 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@Narven
Narven / makefile
Created September 26, 2019 00:46 — forked from sohlich/makefile
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=mybinary
BINARY_UNIX=$(BINARY_NAME)_unix
@Narven
Narven / Vagrantfile
Created September 13, 2019 22:35 — forked from roblayton/Vagrantfile
A Vagrant multi-machine cluster using a loop
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
cluster = {
"master" => { :ip => "192.168.33.10", :cpus => 1, :mem => 1024 },
"slave" => { :ip => "192.168.33.11", :cpus => 1, :mem => 1024 }
}
@Narven
Narven / go-os-arch.md
Created August 22, 2019 09:52 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.8.3 darwin/amd64.

A list of valid GOOS values

(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)

  • android
  • darwin
@Narven
Narven / stream.js
Created April 8, 2019 14:14 — forked from DingGGu/stream.js
NodeJS Mp3 Streaming ExpressJS
var express = require('express');
var app = express();
var fs = require('fs');
app.listen(3000, function() {
console.log("[NodeJS] Application Listening on Port 3000");
});
app.get('/api/play/:key', function(req, res) {
var key = req.params.key;
@Narven
Narven / livestream.js
Last active April 7, 2019 13:11 — forked from deandob/livestream
Node.JS function to remux mp4/h.264 video from an IP camera to a HTML5 video tag using FFMPEG
// Live video stream management for HTML5 video. Uses FFMPEG to connect to H.264 camera stream,
// Camera stream is remuxed to a MP4 stream for HTML5 video compatibility and segments are recorded for later playback
var liveStream = function (req, resp) { // handle each client request by instantiating a new FFMPEG instance
// For live streaming, create a fragmented MP4 file with empty moov (no seeking possible).
var reqUrl = url.parse(req.url, true)
var cameraName = typeof reqUrl.pathname === "string" ? reqUrl.pathname.substring(1) : undefined;
if (cameraName) {
try {
cameraName = decodeURIComponent(cameraName);
var spawn = require("child_process").spawn;
var converter = spawn("gst-launch-0.10", ["filesrc location=/dev/stdin ! decodebin ! audioconvert ! audioresample ! lame ! filesink location=/dev/stdout"]);
converter.stdout.on("data", function(chunk) {
console.log(chunk.toString());
});
converter.stderr.on("data", function(chunk) {
console.log("err: ", chunk.toString());
});
import QtQuick 2.4
Column {
width: parent.width
height: parent.height
property alias model: columnRepeater.model
Repeater {
id: columnRepeater