Skip to content

Instantly share code, notes, and snippets.

@weiglemc
weiglemc / grab-tco.sh
Created November 18, 2022 18:51
Command-line to grab t.co URLs from Twitter archive
awk -F '\"' '/\"url\" :/ {print $4}' tweets.js
@ssrihari
ssrihari / clojure-learning-list.md
Last active May 23, 2024 22:53
An opinionated list of excellent Clojure learning materials

An opinionated list of excellent Clojure learning materials

These resources (articles, books, and videos) are useful when you're starting to learn the language, or when you're learning a specific part of the language. This an opinionated list, no doubt. I've compiled this list from writing and teaching Clojure over the last 10 years.

  • 🔴 Mandatory (for both beginners and intermediates)
  • 🟩 For beginners
  • 🟨 For intermediates

Table of contents

  1. Getting into the language
import re
import PyPDF2
import spacy
class PdfParser():
def __init__(self, file_path):
self.file_path = file_path
def pdf_reader(self) -> str:
content = ''
opener = open(self.file_path, 'rb')
@kidpixo
kidpixo / .gitignore
Last active July 15, 2022 04:52
Interactively search command options from man with fzf
tags
use std::collections::HashMap;
use std::fmt;
use std::io;
use std::num::ParseFloatError;
/*
Types
*/
#[derive(Clone)]
@jonashaag
jonashaag / aws_fargate_docker_application_load_balancer_without_public_ip.md
Last active March 14, 2024 23:34
AWS Fargate Docker Application Load Balancer Howto (without public IP)

AWS Fargate Docker Simple Deployment Setup with SSL termination

How to:

  • create a Docker-based AWS Fargate/ECS deployment
  • without the Docker containers having a public IP
  • with an Application Load Balancer as reverse proxy / SSL termination proxy sitting in front of the containers

For Fargate/ECS to be able to access your Docker images hosted on ECR (or somewhere else) you'll have to allow outbound internet access to the Fargate subnets. Here's how you do it.

import java.util.Arrays;
import java.util.Random;
/**
*
* @author Deus Jeraldy
* @Email: deusjeraldy@gmail.com
*/
public class np {
@Jeraldy
Jeraldy / nn.java
Last active July 25, 2019 14:58
Implementing an Artificial Neural Network in Pure Java (No external dependencies)
/**
*
* @author Deus Jeraldy
* @Email: deusjeraldy@gmail.com
* BSD License
*/
// np.java -> https://gist.github.com/Jeraldy/7d4262db0536d27906b1e397662512bc
import java.util.Arrays;
@matthewpalmer
matthewpalmer / pod.yaml
Last active April 24, 2024 00:00
Example Kubernetes pod for the multi-container sidecar design pattern
# Example YAML configuration for the sidecar pattern.
# It defines a main application container which writes
# the current date to a log file every five seconds.
# The sidecar container is nginx serving that log file.
# (In practice, your sidecar is likely to be a log collection
# container that uploads to external storage.)
# To run:
@angelo-v
angelo-v / jwt-decode.sh
Last active May 12, 2024 14:20
Decode a JWT via command line
# will not work in all cases, see https://gist.github.com/angelo-v/e0208a18d455e2e6ea3c40ad637aac53#gistcomment-3439904
function jwt-decode() {
sed 's/\./\n/g' <<< $(cut -d. -f1,2 <<< $1) | base64 --decode | jq
}
JWT=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ
jwt-decode $JWT