Skip to content

Instantly share code, notes, and snippets.

View electron0zero's full-sized avatar
🎯
Focusing

Suraj Nath electron0zero

🎯
Focusing
View GitHub Profile
#!/usr/bin/env python3
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from dateutil import parser
# Custom date parser
def custom_date_parser(date_string):
date_string = date_string.split(" ")[0] + " " + date_string.split(" ")[1]
@rfratto
rfratto / non_global_metrics.go
Last active February 17, 2021 20:44
One way to do non-global Prometheus metrics in an application
package main
import (
"os"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/prometheus/common/expfmt"
)
@tobi
tobi / kindle.rb
Last active September 25, 2022 02:37
Download your Kindle Highlights to local markdown files. Great for Obsidian.md.
#!/usr/bin/env ruby
# gem install active_support
require 'active_support/inflector'
require 'active_support/core_ext/string'
# gem install webrick (only ruby3)
require 'webrick'
# gem install mechanize
@c0mpiler
c0mpiler / youtube-pihole-adblock.sh
Created July 28, 2020 10:55
youtube-pihole-adblock.sh
echo "created for public use and use."
echo "Start with re-install cleanup."
rm -r /etc/dnsdumpster
rm /var/www/html/youtube-ads-list.txt
rm /etc/pihole/youtube-ads.sh
echo "cleanup done."
echo "installing python-pip and dnsdumpster."
apt-get install python-pip
#!/bin/bash
# 0 * * * * /Users/imiell/git/work/bin/home/slack_start_stop.sh start
# 3-59 * * * * /Users/imiell/git/work/bin/home/slack_start_stop.sh stop
DO_START=0
DO_STOP=0
while [ "$1" != "" ]; do
case $1 in
@dhh
dhh / tracker_blocking.rb
Last active July 27, 2023 14:19
Current list of spy pixels named'n'shamed in HEY, as of April 23, 2020
module Entry::TrackerBlocking
extend ActiveSupport::Concern
included do
has_many :blocked_trackers
end
email_service_blockers = {
"ActiveCampaign" => /lt\.php(.*)?l\=open/,
"AWeber" => "openrate.aweber.com",
@electron0zero
electron0zero / README.md
Last active February 3, 2024 23:10
TP-Link AC600 Archer T2U Nano - Ubuntu 18.04 - Info and drivers
@ktaletsk
ktaletsk / JLab_extensions.md
Last active March 12, 2022 21:28
JupyterLab extensions
@johannaratliff
johannaratliff / learning-golang.md
Last active April 9, 2024 20:07
Golang Rampup

Context

This is for programmers who want to ramp on Go, without resources that reiterate programming fundamentals. This would not be a good list of resources for folks who are learning to program using Go as their first language. Some resources that I dismiss here would be super valuable for newer folks. This is a selection of resources for those who understand programming fundamentals in a different language already.

Advice

  1. First steps = Tour of Go
  2. Don't waste time on Go Fundamentals-type books - it all lives in tour of Go.
  3. Consider joining the Gophers Slack
  4. When you need help, the Go Playground allows you make a quick scratch file and share it. Others trying to help can run your code easily this way.
@electron0zero
electron0zero / .bash_aliases
Last active October 22, 2020 18:48
my ~/.bash_aliases and kubectl_aliases
# === Bash functions that are used in aliases
# get bash shell on docker container.
# works only if one container is running
function get_bash_docker() {
count=$(docker ps -q | wc -l)
if [[ $count = 1 ]]; then
container_id=$(docker ps -q)
echo "Getting bash shell in ${container_id}"
docker exec -it ${container_id} bash