Skip to content

Instantly share code, notes, and snippets.


gianpaolo gianpaolof

  • Italy
View GitHub Profile


Everything here is available under the Unlicense!

gianpaolof / json_parser.c
Created Oct 14, 2020 — forked from alan-mushi/json_parser.c
Examples for the json-c tutorial.
View json_parser.c
* A simple example of json string parsing with json-c.
* clang -Wall -g -I/usr/include/json-c/ -o json_parser json_parser.c -ljson-c
#include <json.h>
#include <stdio.h>
int main() {
struct json_object *jobj;
gianpaolof /
Last active May 7, 2020 — forked from lalitkale/
Update Local Repository Folders Recursively
# Usage:
# ./ [parent_directory]
# example usage:
# ./ C:/GitProjects/ [MAKE SURE YOU USE / SLASHES]
updateRepo() {
local dir="$1"
local original_dir="$2"
cd $dir # switch to the git repo
gianpaolof /
Created May 7, 2020 — forked from smileyborg/
Two scripts that can be used to detect evil merges in Git. See
# A shell script to provide a meaningful diff output for a merge commit that can be used to determine whether the merge was evil.
# The script should be run from outside the git repository, with two arguments:
# 1 - the directory of the git repository
# 2 - the SHA for the merge commit to inspect
# The script will output one file:
# - the merge redone fresh without any conflicts resolved, diff'ed to the actual merge
gianpaolof / redirectExample.go
Created Apr 2, 2020 — forked from d-schmidt/redirectExample.go
How to redirect HTTP to HTTPS with a golang webserver.
View redirectExample.go
package main
import (
func redirect(w http.ResponseWriter, req *http.Request) {
// remove/add not default ports from req.Host
target := "https://" + req.Host + req.URL.Path
if len(req.URL.RawQuery) > 0 {
View gist:7e0fbe3acd2dcc5ce772aa0606a179d2
# Doxyfile 1.8.17
# Project related configuration options
gianpaolof /
Last active May 27, 2020 — forked from robballou/
A script to commit the git parent repo and any submodule changes too
# Usage: ./ "Commit message"
BOLD=$(tput bold)
BLACK=$(tput setaf 0)
WHITE=$(tput setaf 7)
BLUE=$(tput setaf 4)
GREEN=$(tput setaf 2)
NORMAL=$(tput sgr0)
View gist:e383d9b378c3faf596dea170590f7664
> I use the following to squash commits
> git reset $(git merge-base master $(git rev-parse --abbrev-ref HEAD))
> git add -A
> git commit -m "feat(...):..."
> git push -f
gianpaolof / gist:fada9a3fc3fa29fabbe939ca3506b86d
Last active Dec 10, 2019
send/receive json with golang using TLS
View gist:fada9a3fc3fa29fabbe939ca3506b86d
package main
import (
gianpaolof / gist:b181311d13b277d105f8af74576d820a
Created Dec 5, 2019
android emulator with internet connection
View gist:b181311d13b277d105f8af74576d820a
C:\Users\\AppData\Local\Android\Sdk\emulator\emulator.exe -list-avds
C:\Users\\AppData\Local\Android\Sdk\emulator\emulator.exe @Pixel_2_API_25 -dns-server