Skip to content

Instantly share code, notes, and snippets.

@tangentstorm
tangentstorm / sh.mjs
Last active May 5, 2024 02:58
shorthand javascript
// sh.mjs: javascript shorthand
// array helpers (apl/j/k)
export const id=x=>x
export const af=(n,x)=>Array(n).fill(x) // TODO: make this 'afl' or 'fil' (aa?)
export const ii=(n,f)=>{for(let i=0;i<n;i++)f(i)}
export const im=(n,f)=>af(n,0).map((_,i)=>f(i))
export const ia=(n,f)=>im(n,id)
export const at=(a,ixs)=>ixs.map(i=>a[i])
export const io=(xs,ys)=>ys.map([].indexOf.bind(xs))
@svdarren
svdarren / Jupyter-Notebooks.md
Created January 3, 2020 05:27
Workflow notes for Jupyter Notebooks. These are used primarily in the data science community.

Jupyter Notebooks

Go to the GitHub wiki for more background.

Action List

  • Put to-do's here

Workflow & CI/CD

@juanbrujo
juanbrujo / PlayStationBIOSFilesNAEUJP.md
Last active May 5, 2024 02:54
Files for PlayStation BIOS Files NA-EU-JP
@stevendesu
stevendesu / HMAC.js
Created April 30, 2020 16:18
A simple, open-source, HMAC-SHA256 implementation in pure JavaScript. Designed for efficient minification.
// To ensure cross-browser support even without a proper SubtleCrypto
// impelmentation (or without access to the impelmentation, as is the case with
// Chrome loaded over HTTP instead of HTTPS), this library can create SHA-256
// HMAC signatures using nothing but raw JavaScript
/* eslint-disable no-magic-numbers, id-length, no-param-reassign, new-cap */
// By giving internal functions names that we can mangle, future calls to
// them are reduced to a single byte (minor space savings in minified file)
var uint8Array = Uint8Array;
@origamiofficial
origamiofficial / Recaptcha Solver (Automatically solves Recaptcha in browser).user.js
Created March 25, 2022 04:42
Recaptcha Solver in Browser | Automatically solves Recaptcha in browser by engageub | Note: This script is solely intended for the use of educational purposes only and not to abuse any website. This script uses audio in order to solve the captcha. Use it wisely and do not abuse any website. Click "Raw" to install it on Tampermonkey
// ==UserScript==
// @name Recaptcha Solver (Automatically solves Recaptcha in browser)
// @namespace Recaptcha Solver
// @version 2.1
// @description Recaptcha Solver in Browser | Automatically solves Recaptcha in browser
// @author engageub
// @match *://*/recaptcha/*
// @connect engageub.pythonanywhere.com
// @connect engageub1.pythonanywhere.com
// @grant GM_xmlhttpRequest
@jeherve
jeherve / plugin.php
Last active May 5, 2024 02:49
[Post Views For Jetpack] Display a Stats counter at the top of every post, with a "Views:" heading.
<?php
/**
* Display a Stats counter at the top of every post, with a "Views:" heading.
* @see https://wordpress.org/support/topic/page-views-off/
*
* @param string $content Post content.
*/
function jeherve_custom_display_post_views( $content ) {
$post_views = sprintf(
'<div class="stats_counter sd-content"><h3 class="sd-title">%1$s</h3><div class="sd-content">%2$s</div></div>',
@kashifulhaque
kashifulhaque / NvChad.md
Last active May 5, 2024 02:47
Neovim stuff with NvChad

Neovim keybinds

  • Capital letters do the opposite of small letters in command (Press shift to trigger capital letters)
  • _ (underscore) to move the cursor at the beginning of line (doesn't switch to insert mode)
    • 0 (zero) moves the cursor to the zeroth position of the line (doesn't switch to insert mode)
  • $ (dollar) to move the cursor at the end of line (doesn't switch to insert mode)
  • d$ will delete from wherever your cursor is till the end of the line
  • f<character> to move cursor to the first occurrence of <character>
    • f( to move cursor to first occurence of (
  • t<character> to move cursor to upto but not on the first occurrence of <character>
  • t( to move cursor to first occurence of (
@bwann
bwann / README.md
Last active May 5, 2024 02:47
Tunnelling SSH over SSL/TLS

How to tunnel SSH over SSL/TLS

laptop ssh -> laptop stunnel -> evil network -> internet -> your server -> your server ssh

Server (your shell server/home box/work box/whatever)

Sets up a stunnel process listening externally on port 2443/tcp, forwards to localhost 22/tcp

  • Install stunnel, e.g. yum install stunnel
  • Install server config snippet to /etc/stunnel/stunnel.conf
@Leandros
Leandros / random.h
Created July 2, 2018 05:22
C++ Pseudo Random Number Generators
/* Copyright (c) 2018 Arvid Gerstmann. */
/* This code is licensed under MIT license. */
#ifndef AG_RANDOM_H
#define AG_RANDOM_H
class splitmix
{
public:
using result_type = uint32_t;
static constexpr result_type (min)() { return 0; }
@nikolaydyankov
nikolaydyankov / firebase.ts
Last active May 5, 2024 02:33
Svelte x Firebase writable store
// Firestore
export function writableFirestoreStore<T>() {
let unsubscribe: () => void = () => {}
let docRef: any
const store = writable<T | null>(null)
let storeSet = store.set
return {
subscribe: store.subscribe,