Skip to content

Instantly share code, notes, and snippets.

View dinhani's full-sized avatar

Renato Dinhani dinhani

View GitHub Profile
@dinhani
dinhani / backup-saves.py
Last active March 21, 2024 20:01
Watch saves folder or files and backup them on changes
# ------------------------------------------------------------------------------
# imports
# ------------------------------------------------------------------------------
from datetime import datetime
import glob
import ntpath
import os
import sys
import shutil
import time
@dinhani
dinhani / itch-io.py
Created June 9, 2020 21:42
Claim all games from itch.io Racial Justice to your library
# libraries
from selenium import webdriver
# information to fill
YOUR_USERNAME = "itchio_username"
YOUR_PASSWORD = "itchio_password"
YOUR_DOWNLOAD_LINK = "https://itch.io/bundle/download/itchio_unique_code"
# init browser
driver = webdriver.Chrome()
@dinhani
dinhani / plot_repos_star_count.r
Created April 5, 2017 04:40
GitHub repositories star count
library(RJSONIO)
library(ggplot2)
# read data
frequency_json = fromJSON("repos_star_count.json")
frequency_df = as.data.frame(do.call("rbind", frequency_json))
colnames(frequency_df)[1] <- "stars"
colnames(frequency_df)[2] <- "projects"
# generate raw data from dataframe
@dinhani
dinhani / Data after Scanner
Created February 29, 2016 08:01
Neo4J issue #123
{"results":[{"columns":["p","ID(n)"],"data":[{"graph":{"nodes":[{"id":"16917","labels":["ConceptEntry","Game"],"properties":{"uid":"game-borderlands_2","wikidata":"Q893422","name":"Borderlands 2"}}],"relationships":[]},"row":[[{"uid":"game-borderlands_2","wikidata":"Q893422","name":"Borderlands 2"}],16917]},{"graph":{"nodes":[{"id":"16917","labels":["ConceptEntry","Game"],"properties":{"uid":"game-borderlands_2","wikidata":"Q893422","name":"Borderlands 2"}},{"id":"12113","labels":["ConceptEntry","Company"],"properties":{"uid":"company-2k_games","wikidata":"Q94937","name":"2K Games"}}],"relationships":[{"id":"168","type":"PUBLISHES","startNode":"12113","endNode":"16917","properties":{"weight":2.0}}]},"row":[[{"uid":"game-borderlands_2","wikidata":"Q893422","name":"Borderlands 2"},{"weight":2.0},{"uid":"company-2k_games","wikidata":"Q94937","name":"2K Games"}],16917]},{"graph":{"nodes":[{"id":"12259","labels":["ConceptEntry","Company"],"properties":{"uid":"company-aspyr","wikidata":"Q738135","name":"Aspyr"}},{"