Skip to content

Instantly share code, notes, and snippets.

View nikoz84's full-sized avatar

Nicolás Romero nikoz84

  • Brazil - Salvador/BA
View GitHub Profile
@nikoz84
nikoz84 / DenunciaComponent.js
Last active May 21, 2019 14:01
VALIDATOR RULE FOR GOOGLE RECAPTCHA IN LARAVEL AND COMPONENT VUEJS RENDER RECAPTCHA
<template>
<div class="conteiner">
<div class="row col-md-7">
<form v-on:submit.prevent="send()" v-if="!isSend">
<div class="form-group" v-bind:class="{ 'has-error': errors.name && errors.name.length > 0 }">
<label for="nome">Nome:<span class="glyphicon-asterisk"></span></label>
<input type="text" class="form-control" id="nome" v-model="name" placeholder="Digite seu nome">
<small class="text-danger"
v-if="errors.name"
@nikoz84
nikoz84 / encoding-video.md
Created August 24, 2018 21:46 — forked from Vestride/encoding-video.md
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@nikoz84
nikoz84 / html5-video-streamer.js
Created August 28, 2017 17:41 — forked from lleo/html5-video-streamer.js
This is an enhancement to Gist#1993068 https://gist.github.com/paolorossi/1993068 . I found what was needed to demonstrate a functioning video stream was a HTML file with a <video> tag pointing to the streamer.
#!/usr/bin/env node
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
* Modified from https://gist.github.com/paolorossi/1993068
*/
var http = require('http')
, fs = require('fs')
, util = require('util')
@nikoz84
nikoz84 / gist:7f5b8e33f484c1bf0920405b2bd694a2
Created August 27, 2017 16:08 — forked from jpetitcolas/gist:5967887
Encode/decode a base64 encoded string in PostGreSQL
-- Decoding
SELECT CONVERT_FROM(DECODE(field, 'BASE64'), 'UTF-8') FROM table;
-- Encoding
SELECT ENCODE(CONVERT_TO(field, 'UTF-8'), 'base64') FROM table;
@nikoz84
nikoz84 / json_populate_recordset.md
Created August 18, 2017 02:19 — forked from bwestergard/json_populate_recordset.md
json_populate_recordset example
lanetix=# \d foo
           Table "scripting.foo"
 Column |         Type          | Modifiers 
--------+-----------------------+-----------
 id     | integer               | not null
 a      | character varying(40) | not null
 b      | character varying(40) | not null
 c      | character varying(40) | not null
@nikoz84
nikoz84 / ffmpeg.md
Created August 17, 2017 19:58 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@nikoz84
nikoz84 / smashingmagazine.js
Created July 13, 2016 15:10 — forked from luruke/smashingmagazine.js
Source code of the demo "Improving User Flow Through Page Transitions" on Smashing Magazine.
/*
https://www.smashingmagazine.com/2016/07/improving-user-flow-through-page-transitions/
You can copy paste this code in your console on smashingmagazine.com
in order to have cross-fade transition when change page.
*/
var cache = {};
function loadPage(url) {
if (cache[url]) {
@nikoz84
nikoz84 / ffmpeg-html5
Created July 12, 2016 13:13 — forked from yellowled/ffmpeg-html5
Convert videos to proper formats for HTML5 video on Linux shell using ffmpeg. Will probably convert this to a bash script later, but for the time being, here's some examples. Not sure there have actually sensible dimensions and bitrates for web video.
# webm
ffmpeg -i IN -f webm -vcodec libvpx -acodec libvorbis -ab 128000 -crf 22 -s 640x360 OUT.webm
# mp4
ffmpeg -i IN -acodec aac -strict experimental -ac 2 -ab 128k -vcodec libx264 -vpre slow -f mp4 -crf 22 -s 640x360 OUT.mp4
# ogg (if you want to support older Firefox)
ffmpeg2theora IN -o OUT.ogv -x 640 -y 360 --videoquality 5 --audioquality 0 --frontend
@nikoz84
nikoz84 / 0_reuse_code.js
Last active May 17, 2016 15:34
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console