Skip to content

Instantly share code, notes, and snippets.

@mujjingun
mujjingun / PCP.cpp
Last active April 29, 2020 14:50
Undecidable C++ Grammar Example
#include <algorithm>
#include <type_traits>
template <int... Ints>
struct Row {
constexpr static bool empty = (sizeof...(Ints) == 0);
};
template <typename Upper, typename Lower>
struct Domino {
@endolith
endolith / DFT_ANN.py
Last active April 12, 2024 15:46
Training neural network to implement discrete Fourier transform (DFT/FFT)
"""
Train a neural network to implement the discrete Fourier transform
"""
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
import numpy as np
import matplotlib.pyplot as plt
N = 32
batch = 10000
@mewmew
mewmew / ll.bnf
Last active January 16, 2024 15:38
A BNF grammar for LLVM IR assembly
// ### [ Lexical part ] ########################################################
_ascii_letter_upper
: 'A' - 'Z'
;
_ascii_letter_lower
: 'a' - 'z'
;
@aricih
aricih / Colorized Slack.user.js
Last active April 17, 2018 07:12
Colorized Slack Threads and more
// ==UserScript==
// @name Colorized Slack
// @namespace https://www.netsparker.com/
// @version 1.4.1
// @description Colorizes the message threads.
// @author Hakan Arıcı
// @include *.slack.com*
// ==/UserScript==
(function() {
@bsodmike
bsodmike / README.md
Last active March 13, 2023 05:04
OC Nvidia GTX1070s in Ubuntu 16.04LTS for Ethereum mining

Following mining and findings performed on EVGA GeForce GTX 1070 SC GAMING Black Edition Graphics Card cards.

First run nvidia-xconfig --enable-all-gpus then set about editing the xorg.conf file to correctly set the Coolbits option.

# /etc/X11/xorg.conf
Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
@PaulSec
PaulSec / aws_scan.py
Created May 10, 2017 08:05
Quick script to scan for AWS (S3 Buckets) and retrieves bunch of info out of it
import subprocess
import argparse
import re
import sys
import requests
def do_dig(domain):
command = "dig {} | grep IN".format(domain)
try:
output = subprocess.check_output(command, shell=True, stdin=subprocess.PIPE, stderr=subprocess.STDOUT)
@cvan
cvan / webgl-detect-gpu.js
Last active January 19, 2024 02:54
use JavaScript to detect GPU used from within your browser
var canvas = document.createElement('canvas');
var gl;
var debugInfo;
var vendor;
var renderer;
try {
gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
} catch (e) {
}
@atwayne
atwayne / teamcity.process.trigger.ps1
Created May 18, 2016 17:34
A powershell script to trigger TeamCity build via REST API
$user = "username"
$password = "password"
$teamCityHost = "http://teamcity:8082/"
$pair = "$($user):$($password)"
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
$basicAuthValue = "Basic $encodedCreds"
$headers = @{
"Authorization" = $basicAuthValue;
"Accept" = "application/xml";
@cure53
cure53 / 1266386.md
Last active May 30, 2020 17:55
OTF+SVG allows to read info character by character with only a STYLE injection through XEE & timing

OTF+SVG allows to read info character by character with only a STYLE injection through XEE & timing

Intro

Mozilla Firefox supports a feature that allows to define SVG images inside an OTF font to represent characters. This is useful if we for example want to work with colorful characters, Emoji, animated characters and so on. Firefox is currently the only relevant browser supporting this technology.

The general technology and its advantages are described here:

@ynkdir
ynkdir / nls.txt
Last active August 8, 2016 08:45
NLS file format memo
svn://svn.reactos.org/reactos/trunk/reactos/tools/create_nls/
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Nls
format of NLS file such as C:\Windows\System32\C_932.NLS
================================================================================
NLS CODEPAGE (C_XXX.NLS)
================================================================================
+---------------------------------------------------------------