Skip to content

Instantly share code, notes, and snippets.

Avatar

Paulo Silveira peas

View GitHub Profile
@peas
peas / linkedin.js
Last active Jul 21, 2021
linkedin script da loiane pra aprovar amizades massivamente
View linkedin.js
x = document.getElementsByClassName('artdeco-button--secondary'); for (let i=0 ; i<x.length; i++) x[i].click();
// falta paginacao e aceitar >100 numa tacada :P
@peas
peas / video.bash
Last active Aug 2, 2016
aplicacao de chroma e normalizacao de som, esboço
View video.bash
#aplica chroma:
ffmpeg -i video.mp4 -i video-chroma.mp4 -shortest -filter_complex '[1:v]chromakey=0x70de77:0.14:0.03[chroma];[chroma]crop=75/100*in_w:9/10*in_h,scale=w=0.4*iw:h=0.4*ih[chroma_escalado];[0:v][chroma_escalado]overlay=x=main_w-overlay_w-0:y=main_h-overlay_h-0[out]' -map '[out]' video-com-chroma-blend.mkv
#extrai audio
ffmpeg -i video_chroma.mp4 video_audio.wav
#profile do ruido:
sox video_audio.wav -n trim 0 0.5 noiseprof noise.prof
#remove ruido:
@peas
peas / nerdtech2.md
Last active Aug 16, 2016
Links que citamos no NerdTech #2
View nerdtech2.md
View TestaConta.java
class Pessoa {
private String nome;
String cpf;
String endereco;
String getNome() {
return this.nome;
}
void setNome(String nome) {
View MarkdownNovo.java
public class MarkdownNovo {
private static final ScriptEngine JAVASCRIPT;
static {
JAVASCRIPT = new ScriptEngineManager().getEngineByName("javascript");
try {
JAVASCRIPT.eval(new InputStreamReader(MarkdownNovo.class.getResourceAsStream("/marked.js")));
System.out.println(MarkdownNovo.class.getResourceAsStream("/marked.js"));
} catch (ScriptException e) {
View Novo.java
List<Usuario> filtradosOrdenados = usuarios.stream()
.filter(u -> u.getPontos() > 100)
.sorted(Comparator.comparing(Usuario::getNome))
.collect(Collectors.toList());
View Antigo.java
List<Usuario> usuariosFiltrados = new ArrayList<>();
for(Usuario usuario : usuarios) {
if(usuario.getPontos() > 100) {
usuariosFiltrados.add(usuario);
}
}
Collections.sort(usuariosFiltrados, new Comparator<Usuario>() {
public int compare(Usuario u1, Usuario u2) {
return u1.getNome().compareTo(u2.getNome());
View Kumpera.java
import java.util.*;
import java.util.concurrent.*;
import java.util.function.*;
class EWC {
private Consumer<Object> tarefinha;
private Queue<Object> waiters = new ConcurrentLinkedQueue<>();
public void wait(Object arg) {
View javaerror.txt
javac br/com/casadocodigo/java8/Capitulo5.java
br/com/casadocodigo/java8/Capitulo5.java:44: error: variable comparator is already defined in method main(String[])
Comparator<Usuario> comparator =
^
br/com/casadocodigo/java8/Capitulo5.java:58: error: cannot find symbol
.thenComparing(s -> s.length());
^
symbol: method length()
location: variable s of type Object
br/com/casadocodigo/java8/Capitulo5.java:58: error: incompatible types: no instance(s) of type variable(s) U exist so that Comparator<Object> conforms to Comparator<String>
@peas
peas / Rainhas.java
Created Mar 28, 2013
8 rainhas meia boca
View Rainhas.java
public class Rainhas {
private static int[] rainhas = new int[8];
public static void main(String[] args) {
tentaNaPosicao(0);
}
private static void tentaNaPosicao(int coluna) {
for(int linha = 0; linha < 8; linha++) {
if(valido(coluna, linha)) {
rainhas[coluna] = linha;
if(coluna == 7) System.out.println(Arrays.toString(rainhas));