Skip to content

Instantly share code, notes, and snippets.

@doriclaudino
doriclaudino / split.sh
Created May 20, 2020 21:44
split video in scenes
# Splits video to separate scenes files
# Inspired by https://stackoverflow.com/a/38205105
#!/bin/bash
file=""
out="./"
diff=0.4
bitrate="512k"
trim=0
if(!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.io=e():t.io=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t,e){"object"===("undefined"==typeof t?"undefined":i(t))&&(e=t,t=void 0),e=e||{};var n,r=s(t),a=r.source,f=r.id,p=r.path,h=l[f]&&p in l[f].nsps,d=e.forceNew||e["force new connection"]||!1===e.multiplex||h;return d?(u("ignoring socket cache for %s",a),n=c(a,e)):(l[f]||(u("new io instance for %s",a),l[f]=c(a,e)),n=l[f]),r.query&&!e.query?e.query=r.query:e&&"object"===i(e.query)&&(e.query=o(e.query)),n.socket(r.path,e)}function o(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e.join("&")}var i="function"=
/**
* usefull to extract names and typings to typescript
*
* @param obj object to extract info
* @param maxLevel max deep level
*
* startwith low level if you don't understand how deep is your object
* return {...} when reach the maxLevel
*/
function getInterfaces(obj, maxLevel = 2) {
@doriclaudino
doriclaudino / pathAtributes.js
Last active October 4, 2019 15:13
transform objects into paths
let test = {"id1":{"age":30,"name":"dori"}}
let result = {"id1/name":"dori","id1/age":30}
function pathAtributes(object, _key = '', paths = {}) {
if (typeof object !== 'object') return [_key, object]
let path = ''
let keys = Object.getOwnPropertyNames(object)
for (const key in keys) {
path = _key.length ? _key + '/' + keys[key] : keys[key]
let values = getTranslateToPath(object[keys[key]], path, paths)
if (values[0])
@doriclaudino
doriclaudino / generate_string_for_nlp.py
Last active September 25, 2019 02:15
generate_string_for_nlp
import random
space1 = ["+1 ","+1","1 ","1",""]
space2 = ["{0} "," {0}","{0}"," {0} "]
space3 = ["{1} "," {1}","{1}"," {1} "]
space4 = ["{2}"," {2}"]
profissao = ["carpinteiro","carpinteiro finish", "pintor", "driver", "mecanico", "pintor externo", "homem" , "alguem" , "mulher"]
verbo = ["precisa-se de","procuro", "precisase de", "precisa se de", "precisa-se de"]
especificaLocal = ["precisa morar em", "deve morar em","morar em", "trabalhar em", "local do trabalho", "para trabalho fica em", "pra trabalhar em"]
especificaContato = ["contato","ligar para","ligar nesse numero","mandar mensagem para","telefone de contato","telefone","falar com"]
@doriclaudino
doriclaudino / findMissingi18n_using_regex.js
Last active April 17, 2019 19:38
TODO: skip comments
var glob = require('glob')
var fs = require('fs')
var flatten = require('flat')
var username = require("os").userInfo().username
// define variables here
// regex list of possible i18n keys
// our case: tx="" and titleTx=""
var regexList = [
/tx=[\'\"\`](\S+)[\'\"\`]/g,
@doriclaudino
doriclaudino / design_strategy.py
Last active July 12, 2018 15:05
python: strategy design pattern
class Sale(object):
'''create Sale '''
def __init__(self, value):
'''set self.value'''
self.__value = value
@property
def value(self):
'''return self.value'''
# carrega ambiente
workon <ambiente>
# abre o shell
python manage.py shell
# importa modulos Template e Context
from django.template import Template, Context
# define o template com o usuario e filtro upper
@doriclaudino
doriclaudino / gist:e0fbaa2eb6742cf871b1
Created January 14, 2016 10:14 — forked from olivierlacan/gist:4062929
Code School Screencasting Framework

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.
@doriclaudino
doriclaudino / gist:d0ca96ce8b3dfe2bde56
Created January 14, 2016 10:14 — forked from Gregg/gist:968534
Code School Screencasting Framework

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.