Skip to content

Instantly share code, notes, and snippets.

View danielmichaels's full-sized avatar
🇦🇺
Will work for coffee

Daniel Michaels danielmichaels

🇦🇺
Will work for coffee
View GitHub Profile
@snstanton
snstanton / debug.sh
Created August 4, 2021 19:01
Remote debugging k8s with pycharm
job_name=debug-`date +%Y%m%d%H%M%S`
kubectl create job ${job_name} --from cj/myveeva-v118273-app-maint
kubectl label pod -l job-name=${job_name} run=debug
kubectl wait --for condition=Ready pod -l job-name=${job_name}
pod_name=`kubectl get pods -l job-name=${job_name} -o jsonpath='{.items[0].metadata.name}'`
echo "installing tools"
kubectl exec ${pod_name} -- sh -c "apk -q update; apk -q add bash curl jq openssh rsync vim unzip postgresql-client; pip install -q ipython"
@Harshmakadia
Harshmakadia / dataMiner.js
Last active February 22, 2022 13:20
twitter-analytics-data-scraper
// 1. Go to https://analytics.twitter.com/
// 2. Keep scrolling till the end until all the stats data is loaded
// 3. Right click on the page click on last option "Inspect" a window should open select console from that
// 4. copy this entire function
function getVal (val) {
val=val.replace(/\,/g,'');
import logging
from typing import (
List,
Union,
)
from sentry_sdk import add_breadcrumb
from structlog_sentry import SentryJsonProcessor
@seunggabi
seunggabi / semantic-branch-names.md
Last active May 23, 2024 14:05
Semantic Branch Names

Semantic Branch Names

See how a minor change to your branch name style can make you a better programmer.

Format: <type>/#<issueNumber>-<alias>

Example

@rhcarvalho
rhcarvalho / go.mod
Last active January 16, 2024 01:17
Example of using sentry-go and go-chi
module sentry.io/go/chi-example
go 1.13
require (
github.com/getsentry/sentry-go v0.4.0
github.com/go-chi/chi v4.0.3+incompatible
)
@alexellis
alexellis / MULTIPASS_OPENFAAS.md
Last active December 5, 2022 03:39
Get k3s with OpenFaaS using k3sup and multipass

Get k3s with OpenFaaS using k3sup and multipass

multipass from Canoncial is like Docker Desktop, but for Ubuntu and works on MacOS, Linux and Windows.

Use-case:

We can get a Kubernetes cluster with k3s in a very short period of time. We can use this for workshops and building labs, and for R&D, including testing.

@franciscocpg
franciscocpg / README.md
Last active May 13, 2024 08:48
Import mitm certificate to CA in arch linux
  1. After installing mitmproxy run it (just type mitmproxy) in a terminal session and quit. This will create the necessaries certificates files at ~/.mitmproxy.

  2. Extract the certificate to .crt format:
    openssl x509 -in ~/.mitmproxy/mitmproxy-ca.pem -inform PEM -out ca.crt

  3. Trust the certificate into CA:
    sudo trust anchor ca.crt

  4. Run the mitmproxy again

@JackAtOmenApps
JackAtOmenApps / article_confirm_delete.html
Last active September 1, 2022 15:25
This is a super basic example of using django-summernote to create a knowledgebase app in django (Make sure to pip install django-summernote)
{% extends "base.html" %}
{% load static %}
{% block title %}{% block head_title %}Knowledgebase - Delete {{ article.name }}{% endblock head_title %}{% endblock title %}
{% block content %}
<div class="container-fluid">
<div class="row ml-1 mr-1">
<div class="col-md-12">
"""
Django ORM Optimization Tips
Caveats:
* Only use optimizations that obfuscate the code if you need to.
* Not all of these tips are hard and fast rules.
* Use your judgement to determine what improvements are appropriate for your code.
"""
# ---------------------------------------------------------------------------
@swyxio
swyxio / 1.md
Last active February 8, 2024 22:30
Learn In Public - 7 opinions for your tech career

2019 update: this essay has been updated on my personal site, together with a followup on how to get started

2020 update: I'm now writing a book with updated versions of all these essays and 35 other chapters!!!!

1. Learn in public

If there's a golden rule, it's this one, so I put it first. All the other rules are more or less elaborations of this rule #1.

You already know that you will never be done learning. But most people "learn in private", and lurk. They consume content without creating any themselves. Again, that's fine, but we're here to talk about being in the top quintile. What you do here is to have a habit of creating learning exhaust. Write blogs and tutorials and cheatsheets. Speak at meetups and conferences. Ask and answer things on Stackoverflow or Reddit. (Avoid the walled gardens like Slack and Discourse, they're not public). Make Youtube videos