Skip to content

Instantly share code, notes, and snippets.

@hiteshchoudhary
hiteshchoudhary / authors.json
Created November 24, 2023 05:54
Random data to learn aggregation pipelines in MongoDB
[
{
"_id": 100,
"name": "F. Scott Fitzgerald",
"birth_year": 1896
},
{
"_id": 101,
"name": "George Orwell",
"birth_year": 1903
@isaqueprofeta
isaqueprofeta / siem_training.md
Last active April 19, 2024 16:58
SIEM Training
@juanbrujo
juanbrujo / comunas-regiones.json
Last active April 19, 2024 16:58 — forked from sergiohidalgo/comunas-regiones-chile.json
Comunas y regiones de chile JSON
{
"regiones": [
{
"region": "Arica y Parinacota",
"comunas": ["Arica", "Camarones", "Putre", "General Lagos"]
},
{
"region": "Tarapacá",
"comunas": ["Iquique", "Alto Hospicio", "Pozo Almonte", "Camiña", "Colchane", "Huara", "Pica"]
},
@benwattsjones
benwattsjones / gmail_mbox_parser.py
Last active April 19, 2024 16:55
Quick python code to parse mbox files, specifically those used by GMail. Extracts sender, date, plain text contents etc., ignores base64 attachments.
#! /usr/bin/env python3
# ~*~ utf-8 ~*~
import mailbox
import bs4
def get_html_text(html):
try:
return bs4.BeautifulSoup(html, 'lxml').body.get_text(' ', strip=True)
except AttributeError: # message contents empty
info
@miguelmota
miguelmota / i3-cheat-sheet.md
Last active April 19, 2024 16:49 — forked from JeffPaine/i3-cheat-sheet.md
i3 Window Manager Cheat Sheet

i3 Window Manager Cheat Sheet

$mod refers to the modifier key (window/command or alt by default depending on config)

General

  • startx i3 start i3 from command line
  • $mod+<Enter> open a terminal
  • $mod+d open dmenu (text based program launcher)
  • $mod+r resize mode ( or to leave resize mode)
  • $mod+shift+e exit i3
@storeman
storeman / php_unserialize_to_json.sql
Last active April 19, 2024 16:49
PHP unserialize in Postgresql to json
/**
Decode a php serialized value to json. This function only supports basic
data types:
- arrays (will always become a json object)
- booleans
- integers
- floats
- strings
- NULL
The php_unserialize(text) function is a helper function which extracts the first value
@gtallen1187
gtallen1187 / slope_vs_starting.md
Created November 2, 2015 00:02
A little bit of slope makes up for a lot of y-intercept

"A little bit of slope makes up for a lot of y-intercept"

01/13/2012. From a lecture by Professor John Ousterhout at Stanford, class CS140

Here's today's thought for the weekend. A little bit of slope makes up for a lot of Y-intercept.

[Laughter]

@kn0412
kn0412 / Arrow.java
Last active April 19, 2024 16:48
Arrow class for JavaFX
import javafx.scene.paint.Color;
import javafx.scene.shape.LineTo;
import javafx.scene.shape.MoveTo;
import javafx.scene.shape.Path;
/**
*
* @author kn
*/
public class Arrow extends Path{
@ulidtko
ulidtko / qnap-qts-fw-cryptor.py
Last active April 19, 2024 16:45
QNAP QTS firmware encryptor/decryptor.
#!/usr/bin/env python3
import os, sys
import argparse
import struct
from functools import reduce
"""
QNAP QTS firmware encryptor/decryptor.
Based on https://pastebin.com/KHbX85nG