Skip to content

Instantly share code, notes, and snippets.

$ cat ~/fragment8.txt

• The year is 𝟮𝟬𝟴𝟯.

In a post-Amazon world, brain-computer interfaces are widespread. Although expensive, with the total operating cost approaching 20 years of median United States income (and reducing life expectancy by about as much), they are essential for employment. Most people, even young adults, adapt to the newly acquired sensory and control capabilities only in a rudimentary way. Still, this gives you enough of an advantage over your peers that the last two decades saw a steep decline in workplaces where an unaltered human could succeed; or pass a single performance review.

Every parent looking out for their child's future wants to see them transition to the altered life as early as they can—and, since the CLEAR MINDS Act passed in 2061, that means the age of 24. With the prefrontal cortex fully formed and the brain's plasticity almost gone, even the latest low-power hybrid ASIC driving hundreds of implanted electrodes amounts to little more than an awkward way to keep up wit

@wrighter
wrighter / download_bars.py
Last active May 3, 2024 21:38
A command line utility to download historical data from Interactive Brokers
#!/usr/bin/env python
import os
import sys
import argparse
import logging
from datetime import datetime, timedelta
from typing import List, Optional
from collections import defaultdict

GitHub Search Syntax for Finding API Keys/Secrets/Tokens

As a security professional, it is important to conduct a thorough reconnaissance. With the increasing use of APIs nowadays, it has become paramount to keep access tokens and other API-related secrets secure in order to prevent leaks. However, despite technological advances, human error remains a factor, and many developers still unknowingly hardcode their API secrets into source code and commit them to public repositories. GitHub, being a widely popular platform for public code repositories, may inadvertently host such leaked secrets. To help identify these vulnerabilities, I have created a comprehensive search list using powerful search syntax that enables the search of thousands of leaked keys and secrets in a single search.

Search Syntax:

(path:*.{File_extension1} OR path:*.{File_extension-N}) AND ({Keyname1} OR {Keyname-N}) AND (({Signature/pattern1} OR {Signature/pattern-N}) AND ({PlatformTag1} OR {PlatformTag-N}))

Examples:

**1.

@SynCap
SynCap / remove_node_modules_recursively.ps1
Last active May 3, 2024 21:37
Remove `node_modules` folders in Windows in all subfolders recursively with PowerShell to avoid exceeding path max_length
<#
Note: Eliminate `-WhatIf` parameter to get action be actually done
Note: PS with version prior to 4.0 can't delete non-empty folders
#>
Get-ChildItem -Path "." -Include "node_modules" -Recurse -Directory | Remove-Item -Recurse -Force -WhatIf
@c141charlie
c141charlie / Program.fs
Created October 18, 2010 22:49
Use F# to extract information from multiple Excel files
//If you're running this code using F# REPL then you have to do run this command:
//#r "C:\Program Files\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office14\Microsoft.Office.Interop.Excel.dll"
//Open up the correct namespace
open Microsoft.Office.Interop.Excel
//Open Excel
let xl = new ApplicationClass(Visible = true)
@interactivetech
interactivetech / pycocotools_tutorial.ipynb
Created January 17, 2021 22:10
Detailed Walkthrough of pycocotools and Python COCO API
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Generating Procedural Game Worlds with Wave Function Collapse

Wave Function Collapse (WFC) by @exutumno is a new algorithm that can generate procedural patterns from a sample image. It's especially exciting for game designers, letting us draw our ideas instead of hand coding them. We'll take a look at the kinds of output WFC can produce and the meaning of the algorithm's parameters. Then we'll walk through setting up WFC in javascript and the Unity game engine.

sprites

The traditional approach to this sort of output is to hand code algorithms that generate features, and combine them to alter your game map. For example you could sprinkle some trees at random coordinates, draw roads with a brownian motion, and add rooms with a Binary Space Partition. This is powerful but time consuming, and your original vision can someti

@davidrjonas
davidrjonas / flatmap.php
Last active May 3, 2024 21:29
Simple flatmap() or mapcat() for PHP 7
<?php
/**
* If you need something safer or more complete see https://github.com/lstrojny/functional-php,
* in particular, https://github.com/lstrojny/functional-php/blob/master/src/Functional/FlatMap.php
*
* @param Callable $fn Mapping function that returns an array
* @param array $array Data over which $fn will be mapped
* @return array
*/