Skip to content

Instantly share code, notes, and snippets.

View dansku's full-sized avatar
🌮
Focusing on tacos

Daniel Andrade dansku

🌮
Focusing on tacos
View GitHub Profile
@dansku
dansku / git-change-commit-messages.md
Created March 5, 2019 11:05 — forked from nepsilon/git-change-commit-messages.md
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

@dansku
dansku / config.yaml
Created March 2, 2019 14:45
beets config
directory: /mnt/d/@TORRENCIAL/musicas
library: /mnt/d/@TORRENCIAL/musiclibrary.blb
import:
move: yes
plugins: fetchart embedart inline
paths:
default: $albumartist/($year) $album%aunique{}/%if{$multidisc,Disc $disc/}$track $title
@dansku
dansku / organize_photos_dropbox.go
Last active August 30, 2018 18:13
Script to organize photos upload to Camera Upload dropbox folder.
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"strconv"
"strings"
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript" charset="utf-8">
</script>
int relayPin = D7; // choose the pin for the LED
int openCall(String extra) {
digitalWrite(relayPin, LOW);
delay(1500);
digitalWrite(relayPin, HIGH);
Particle.publish("house_door_open"); // Slack web hook to open the door
return 1;
}
@dansku
dansku / blynk.c
Created August 12, 2018 18:37
door automation with blynk
#define BLYNK_PRINT Serial
#include <blynk.h>
// You should get Auth Token in the Blynk App.
char auth[] = "auth_code_goes_here";
int relayPin = D7; // choose the pin for the LED
// blynk function
BLYNK_WRITE(V1)
@dansku
dansku / door.c
Created August 11, 2018 21:34
blynk open house door app
#define BLYNK_PRINT Serial
#include <blynk.h>
// You should get Auth Token in the Blynk App.
char auth[] = "";
int relayPin = D7; // choose the pin for the LED
// blynk function
BLYNK_WRITE(V1)
@dansku
dansku / fix_hackernoon_tempermonkey.js
Created July 23, 2018 14:48
Remove Hackernoon annoying sticky bottom/header
// ==UserScript==
// @name Hackernoon Update
// @namespace https://www.danielandrade.net
// @version 0.1
// @description Remove Hackernoon annoying sticky bottom/header
// @author Daniel Spillere Andrade
// @match https://hackernoon.com/*
// ==/UserScript==
function addGlobalStyle(css) {
@dansku
dansku / restart.py
Created February 17, 2018 02:09
restarting script when it crashes
#!/bin/sh
COMMAND='python /home/runcloud/parser/live.py'
LOGFILE=restart.txt
writelog() {
now=`date`
echo "$now $*" >> $LOGFILE
}
import os
import time
import mysql.connector
from validate_email import validate_email
import time
Server = mysql.connector.connect(host="127.0.0.1", user="root", passwd="root", db="pwdquery", port=8889)
Cursor = Server.cursor()
# Get a list of files to read