Skip to content

Instantly share code, notes, and snippets.

View israeljrs's full-sized avatar

Israel Junior israeljrs

View GitHub Profile
@israeljrs
israeljrs / SingleValueEvent.java
Created December 2, 2016 18:05
Sample of use the Firebase SingleValueEvent Listener.
public class MainActivity extends Activity {
private Firebase mRef;
private HashMap<Firebase, ValueEventListener> mListenerMap;
@Override
protected void onStart() {
super.onStart();
mRef = new Firebase("https://<your-firebase-app>/myChatRooms/testUser");
@israeljrs
israeljrs / args.rb
Last active January 11, 2017 23:09
sample the use args.
v1 = ARGV[0]
v2 = ARGV[1]
puts "Primeiro parametro : #{v1}"
puts "Segundo parametro : #{v2}"
puts "fim do arquivo."
@israeljrs
israeljrs / get-video-file-informations.md
Created February 27, 2017 01:26
FFmpeg get video file informations.

Using ffmpeg to get video informations

To get information about a file (say video.mp4), run the following command. Remember you have to specify an ouput file, but in this case we only want to get some information about the input file.

$ ffmpeg -i movie.mp4 -hide_banner
@israeljrs
israeljrs / encoding_with_frei0r.md
Last active December 4, 2024 12:43
ffmpeg using filter frei0r with distort0r.

Encoding with frei0r.

To encoding your movie with frei0r filter distort0r using the ffmpeg follow command below.

$ ffmpeg -i movie01.mp4 -vf "frei0r=distort0r|0.1|0.01" -f mp4 -y new_movie.mp4
@israeljrs
israeljrs / ng_cli_add_sass.md
Last active March 16, 2017 12:51
how add sass to ng-cli

How add sass to angular 2 cli

New project

For new projects we can set the options --style=sass or --style=scss according to the desired flavor SASS/SCSS

$ ng new project --style=sass
@israeljrs
israeljrs / angular2_setup.md
Created March 16, 2017 19:03
step by step to setup angular 2 and firebase.

basic setup to make project using angular 2 and firebase.

create basic project with support to sass.

$ ng new project_name --style sass --routing true

check if project is make rigth.

$ cd project_name
@israeljrs
israeljrs / upload.component.ts
Created April 4, 2017 20:08 — forked from StephenFluin/upload.component.ts
Firebase Uploader Component with Angular 2
import { Component, Input } from '@angular/core';
import { Router } from '@angular/router';
import { AngularFire, FirebaseListObservable } from 'angularfire2';
import { Observable } from 'rxjs';
declare var firebase: any;
interface Image {
path: string;
@israeljrs
israeljrs / curl.md
Created April 11, 2017 17:43 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@israeljrs
israeljrs / c_json_servlet.c
Created September 7, 2017 11:56 — forked from dcollien/c_json_servlet.c
C program for a libevent server receiving JSON requests and replying with JSON responses over HTTP
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <event.h>
#include <evhttp.h>
@israeljrs
israeljrs / app.js
Created September 12, 2017 14:21
http2_node.js
const http2 = require('http2')
const server = http2.createSecureServer(
{ cert, key },
onRequest
)
function push (stream, filePath) {
const { file, headers } = getFile(filePath)
const pushHeaders = { [HTTP2_HEADER_PATH]: filePath }
stream.pushStream(pushHeaders, (pushStream) => {
pushStream.respondWithFD(file, headers)