Skip to content

Instantly share code, notes, and snippets.

View pedrolopesme's full-sized avatar
💡
Coding.

Pedro Mendes pedrolopesme

💡
Coding.
View GitHub Profile
@pedrolopesme
pedrolopesme / youtube_peacemaker.js
Created February 21, 2023 18:31
Remove Youtube suggestions based on a word list
const words = ["lula", "bolsonaro"]
let peaceMaker = function() {
suggestions = document.getElementsByTagName('ytd-rich-item-renderer');
for (let i = 0; i < suggestions.length; i++) {
substrings = suggestions[i].getElementsByTagName('yt-formatted-string');
for (let ii = 0; ii < substrings.length; ii++) {
text = substrings[ii].textContent;
if(words.some(function(v) { return text.toLowerCase().indexOf(v) >= 0; })){
suggestions[i].remove();
[test]: Update test/* files
[dist]: Changes to submodules, version bumps, updates to package.json
[minor]: Small changes
[doc]: Updates to documentation
[fix]: Bug fixes
[bin]: Update binary scripts associated with the project
[refactor]: Refactor of existing code
[nit]: Small code review changes mainly around style or syntax
[feat]: New features

Homebrew Formula for a Go app

These are quick notes from making a glan Formula and Tap.

Add go build script to your Git repo

gobuild.sh

#!/bin/bash
package main
import (
"fmt"
"github.com/gorilla/websocket"
"net/http"
)
var upgrader = websocket.Upgrader{
ReadBufferSize: 1024,
var upgrader = websocket.Upgrader{
ReadBufferSize: 1024,
WriteBufferSize: 1024,
CheckOrigin: func(r *http.Request) bool { return true },
}
package main
import (
"fmt"
"net/http"
)
func main() {
http.HandleFunc("/", handler) // Aqui declaramos o path e o Handler
http.ListenAndServe(":3000", nil) // Aqui ficará a porta em que nosso Web server vai responder
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello!")
}
@pedrolopesme
pedrolopesme / iterm2-solarized.md
Created September 2, 2017 20:33 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

fun main(args: Array<String>) {
var sum = 0
val myList = listof(1,3,6,7)
myList.forEach{ sum += it }
println(sum) // imprime 17
}
fun main(args: Array<String>) {
val myList = listof(1,3,6,7)
// x deixa de ser declarado e vira somente "it"
val greaterThan5 = myList.count{ it > 5 }
}