Skip to content

Instantly share code, notes, and snippets.

@nom3ad
nom3ad / bookmarklets.md
Created December 28, 2022 16:24 — forked from ElectricRCAircraftGuy/bookmarklets.md
These are bookmarklets (ie: browser bookmarks with Javascript in them) to perform functions to help make your GitHub PR review life easier.
@nom3ad
nom3ad / eols.sh
Created September 2, 2022 08:25 — forked from byroot/eols.sh
Convert the whole git history with dos2unix
git filter-branch --tree-filter 'git ls-files -z | xargs -0 dos2unix' -- --all
@nom3ad
nom3ad / gist:7f3c9716efdc26d66ace809792f60b26
Created June 5, 2022 06:56 — forked from romuald/gist:0346c76cfbbbceb3e4d1
Sub-millisecond profiling for python pstats
# -*- coding: utf8 -*-
"""
A simple monkeypath for the pstats module to be able to see sub-millisecond timings
If display value is 0.000, display the time in microseconds
"""
import pstats
def f8(x):
@nom3ad
nom3ad / rerender.directive.ts
Created May 15, 2022 17:35 — forked from anhkind/rerender.directive.ts
Angular directive to re-render a template if it detects any changes of the input
/**
* Example:
*
* <ng-container *rerender='changingInput'>
* this content will be re-rendered everytime `changingInput` changes
* </ng-container>
*/
import { Directive,
Input,
mkdir /tmp/www
cd /tmp/www; touch "$(hostname).txt"
sudo nohup python -m SimpleHTTPServer 80 > simplehttpserver.out &
#Start an HTTPS listener with some debug responses (I wonder if you can pipe to the HTTP server)
openssl req -x509 -newkey rsa:4096 -nodes -sha256 -keyout /tmp/key.pem -out /tmp/cert.pem -days 365 #Create self signed key. Only need this once and it will ask a few questions
sudo nohup openssl s_server -key /tmp/key.pem -cert /tmp/cert.pem -accept 443 -cipher kRSA+RSA -www > openssl.out &
@nom3ad
nom3ad / aws-iam-poilcy-schema.json
Created January 25, 2022 10:15 — forked from jstewmon/aws-iam-poilcy-schema.json
AWS IAM Policy JSON Schema
{
"type": "object",
"required": ["Statement"],
"additionalProperties": false,
"properties": {
"Version": {
"type": "string",
"enum": ["2008-10-17", "2012-10-17"]
},
"Id": {
@nom3ad
nom3ad / functions.sh
Created December 14, 2021 13:56 — forked from junegunn/functions.sh
Key bindings for git with fzf (https://junegunn.kr/2016/07/fzf-git/)
# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --height 50% --min-height 20 --border --bind ctrl-/:toggle-preview "$@"
}
#!/usr/bin/env python
# https://github.com/jfsanchez91/pystun3/blob/py3-support/stun/__init__.py
import binascii
import logging
import random
import socket
import sys
@nom3ad
nom3ad / es6-class-to-es5-transpilation.md
Last active September 23, 2021 08:32
ts-playground
class A {
    public x;
    constructor(x: number) {
        this.x =x
    }
    Foo(){

    }
}
@nom3ad
nom3ad / Jenkinsfile
Created May 10, 2021 04:16 — forked from fedevegili/Jenkinsfile
Idle hours for jenkins ec2 fleet plugin
pipeline {
agent {
label 'jenkins-worker-light'
}
triggers {
cron(env.BRANCH_NAME == 'master' ? '*/15 * * * *' : '')
}
options {
timeout(time: 60, unit: 'SECONDS', activity: false)
}