Skip to content

Instantly share code, notes, and snippets.

View zautomata's full-sized avatar
🌴
On vacation

zautomata

🌴
On vacation
  • BH, Brazil
View GitHub Profile
@zautomata
zautomata / README.md
Created July 30, 2022 10:43 — forked from MichaelCurrin/README.md
GitHub GraphQL - Get owned repos

Public repos owned by the current user

Get repos from the GitHub GraphQL API which are owned by the authenticated user (owner of the token).

Customize the query

Instead of OWNER, you can also change the ownerAffiliations filter in the query to be COLLABORATOR or ORGANIZATION_MEMBER. Or omit the filter.

Instead of setting privacy filter to PUBLIC, you can set to PRIVATE. Or omit the filter.

@zautomata
zautomata / GetRepositoryInfo.gql
Created July 30, 2022 10:43 — forked from katopz/GetRepositoryInfo.gql
GraphQL Github Example : Get repository info.
// Try at : https://graphql-explorer.githubapp.com/
query {
repositoryOwner (login: "facebook") {
repositories {
totalCount
}
repository(name: "react") {
description
forks {
totalCount
@zautomata
zautomata / ipfs-on-raspberry-pi.md
Created July 1, 2022 10:07 — forked from peterVG/ipfs-on-raspberry-pi.md
Put IPFS decentralized storage on your Raspberry Pi with USB storage

I put IPFS on a Raspberry Pi and so should you!

Total cost of joining the decentralized storage revolution with your own lo-fi node: $124 USD

raspberry-ipfs

@zautomata
zautomata / go-shebang-story.md
Created December 30, 2021 10:10 — forked from posener/go-shebang-story.md
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@zautomata
zautomata / ssh-multi.sh
Created June 13, 2019 17:38 — forked from dmytro/ssh-multi.sh
Start multiple synchronized SSH connections with Tmux
#!/bin/bash
# ssh-multi
# D.Kovalov
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html
# a script to ssh multiple servers over multiple tmux panes
starttmux() {
if [ -z "$HOSTS" ]; then
@zautomata
zautomata / haversine.py
Created June 4, 2019 22:53 — forked from rochacbruno/haversine.py
Calculate distance between latitude longitude pairs with Python
#!/usr/bin/env python
# Haversine formula example in Python
# Author: Wayne Dyck
import math
def distance(origin, destination):
lat1, lon1 = origin
lat2, lon2 = destination
@zautomata
zautomata / readme.md
Created November 17, 2018 17:38 — forked from thomasdarimont/readme.md
Example for decoding a JWT Payload with your Shell (bash, zsh...)

Setup

Add this to your .profile, .bashrc, .zshrc...

decode_base64_url() {
  local len=$((${#1} % 4))
  local result="$1"
  if [ $len -eq 2 ]; then result="$1"'=='
  elif [ $len -eq 3 ]; then result="$1"'=' 
  fi
 echo "$result" | tr '_-' '/+' | openssl enc -d -base64
@zautomata
zautomata / curl.md
Created October 27, 2018 15:07 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@zautomata
zautomata / index.html
Created September 21, 2018 19:02 — forked from wboykinm/index.html
Stamen Toner-Hybrid reference overlay
<!DOCTYPE html>
<html>
<head>
<title>Leaflet Switching + CartoDB</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="http://geosprocket.com/assets/leaflet/dist/leaflet.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="http://geosprocket.com/assets/leaflet/dist/leaflet.ie.css" /><![endif]-->
@zautomata
zautomata / Readme.md
Created September 21, 2018 19:02 — forked from cccruzr/Readme.md
Leaflet.js multiple basemap tiles example

Leaflet.js multiple basemap tiles example

This is an example of using multiple basemap tiles on Leaflet.

The detailed explanation can be found on my blog.

Camilo Cruz, 2017.