Skip to content

Instantly share code, notes, and snippets.

View goncalossilva's full-sized avatar

Gonçalo Silva goncalossilva

View GitHub Profile
#!/usr/bin/env python3
#
# Open With Nautilus Extension.
#
# Install python-nautilus and put this in ~/.local/share/nautilus-python/extensions/.
from gi import require_version
require_version("Gtk", "3.0")
require_version("Nautilus", "3.0")
@goncalossilva
goncalossilva / gist:3390929c78b0cfc1dceff447387472f4
Created January 26, 2020 02:56
Bookmarklet for Mario's Todoist
javascript:document.addEventListener("click",async function(e){if(e.target&&e.target.classList.contains("item_checkbox")&&!e.target.checked){var a=new Audio("https://themushroomkingdom.net/sounds/wav/smw/smw_coin.wav");a.type="audio/wav";await a.play()}})
// On a Huawei Watch
// 2225ms
for (i in 0..10000) {
launch(UI) {
withContext(DefaultDispatcher) { }
}
}
// 10ms
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Catleap"
HorizSync 143.073
VertRefresh 95.002
Modeline "2560x1440_95" 389.16 2560 2608 2640 2720 1440 1443 1448 1506 +hsync -vsync
Option "DPMS"
EndSection
//<![CDATA[
// a few things don't have var in front of them - they update already existing variables the game needs
lanesSide = 3;
patchesAhead = 52;
patchesBehind = 12;
trainIterations = 500000;
// the number of other autonomous vehicles controlled by your network
@goncalossilva
goncalossilva / .gitconfig
Last active April 8, 2021 15:25
Autoremove deleted and merged branches, locally and remotely.
[alias]
autoremove = "!f() { \
whitelist=\"master|dev|legacy\"; \
git fetch --prune; \
if [ -z \"$1\" ]; then \
list=$(git branch --merged | egrep -v \"(^\\*|$whitelist)\") && \
cmd='echo \"$list\" | xargs -n 1 git branch -d'; \
else \
list=$(git branch -r --merged | grep \"$1\" | egrep -v \"(>|$whitelist)\") && \
cmd='echo \"$list\" | cut -d'/' -f2- | xargs -n 1 git push \"$1\" --delete'; \

Porto Summer of Code, 9 a 11 de Setembro

O Porto Summer of Code é uma competição de programação de 3 dias que já vai na terceira edição. Além da competição, vai haver workshops, vários gadgets (VR, wearables, etc), gaming stations e uma zona de chill-out para relaxar e confraternizar.

Este ano, pela primeira vez, o evento está aberto a todos. E é aí que vocês entram: convido-vos a formar uma equipa e a surgir no evento. Além de 3 dias de diversão, há prémios ;)

Além de se juntarem a nós, agradecia se pudessem divulgar o evento nos vossos meios. Temos pessoas inscritas de todo o país, mas é sempre muito complicado chegar a toda a gente.

Eis alguns conteúdos que podem ser utilizados para espalhar a palavra:

public class Message {
private long id;
private long userId;
private long postedTs;
private String content;
public Message(long id, long userId, long postedTs, String content) {
this.id = id;
this.userId = userId;
this.postedTs = postedTs;
@goncalossilva
goncalossilva / gifenc.sh
Last active December 12, 2023 22:31
Encode mp4, webm and gif using ffmpeg (2.6 or above). Audio is discarded on all of these!
#!/bin/sh
# sh gifenc.sh input.mp4 output.gif
# Optionally accepts width / height (one or both).
palette="/tmp/palette.png"
filters="fps=15"
if [ -n "$3" ]; then
if [ -n "$4" ]; then
filters="$filters,scale=$3:$4"
### Keybase proof
I hereby claim:
* I am goncalossilva on github.
* I am goncalossilva (https://keybase.io/goncalossilva) on keybase.
* I have a public key whose fingerprint is C272 B075 3313 6571 5980 70A5 4AC5 F859 0A77 0315
To claim this, I am signing this object: