Skip to content

Instantly share code, notes, and snippets.

View hugoleodev's full-sized avatar
🎯
Focusing

Hugo Leonardo hugoleodev

🎯
Focusing
View GitHub Profile
@hugoleodev
hugoleodev / 00_destructuring.md
Created June 19, 2022 01:47 — forked from john2x/00_destructuring.md
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@hugoleodev
hugoleodev / gist:31c5bdd5f89a6be118c332f3b2fb2173
Created September 28, 2021 23:24 — forked from jeoliva/gist:a3c4ef62b7f52926d0f339b395c0cd0c
Get Keyframe interval (GOP size) of a stream/video using ffprobe
ffprobe -of compact -select_streams v -show_packets [VIDEO_FILE OR STREAM_URL] | grep K$ | awk 'BEGIN{FS="|";last=-1}{split($5,a,"="); if(last != -1) {print "Keframe pos: " a[2] ", Interval: " a[2]-last " seconds"} else {print "Keyframe: " a[2]}; last=a[2]}'
@hugoleodev
hugoleodev / gist:1178ac72f6f8eae8a91d7d14fec70a11
Created September 28, 2021 23:24 — forked from tayvano/gist:6e2d456a9897f55025e25035478a3a50
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@hugoleodev
hugoleodev / predict.py
Created July 6, 2021 19:53 — forked from greencoder/predict.py
SKLearn Linear Regression Stock Price Prediction
from __future__ import print_function
import numpy as np
import pandas as pd
import talib as ta
import pandas_datareader as web
from sklearn.linear_model import LinearRegression
from sklearn.linear_model import Ridge
from sklearn.model_selection import cross_val_score
@hugoleodev
hugoleodev / translate-srt.py
Created April 2, 2017 18:19 — forked from jney/translate-srt.py
translate a srt file with google translate
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys,json,urllib
from pysrt import SubRipFile, SubRipItem
url_string = 'http://ajax.googleapis.com/ajax/services/language/'
def detect(text):
query = dict(v='1.0', q=text)
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@hugoleodev
hugoleodev / README.md
Last active August 29, 2015 14:28 — forked from tkhduracell/README.md
Configure Google Hangout notifications on Jenkins

Install plugins

  • instant-messaging plugin
  • Jabber notifier plugin

Jenkins > Manage Jenkins > Configure System > Jabber Notification

  • Enable Jabber Notification
  • Jabber ID: <[email protected]>
  • Password: <your password>
  • Advanced
  • Server: talk.google.com
Sete Atitudes para Hackear a Indústria de Software
By Klaus Wuestefeld
1) Torne-se excelente.
Seja realmente bom em alguma coisa. Não fique só choramingando ou
querendo progredir às custas dos outros. Não pense q pq vc sentou 4
anos numa faculdade ouvindo um professor falar sobre software q vc
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo

Whether you use 2 spaces or 4 spaces, there are a few simple things that can make your node.js code easier to read. We've been using them in all the hapi modules for over 4 years now to great results. This list is by no means complete but it highlights the most useful elements that will give you immediate value in reducing bugs.

Required modules

JavaScript makes it harder than most languages to know where variables are coming from. Variables assigned required modules are particularly important because they represent a singleton object shared with the entire application. There are also globals and module globals, along with function variables and arguments.

Traditionally, variables starting with an uppercase letter represent a class that must be instantiated using new. This was an important semantic in the early days of JavaScript but at this point, if you don't know Date requires new Date() you are probably very new. We have adopted Upper Camel Case variable names for all module global variables