Skip to content

Instantly share code, notes, and snippets.

View chrstphrchvz's full-sized avatar
🕳️
I tend to disappear

Christopher Chavez chrstphrchvz

🕳️
I tend to disappear
  • San Antonio, TX
View GitHub Profile
#!/usr/bin/env bash
clang++ -std=c++14 -stdlib=libc++ -c string16.ii
clang++ -std=c++14 -stdlib=libc++ -c utf_string_conversions.ii
clang++ -std=c++14 -stdlib=libc++ string16.o utf_string_conversions.o
#!/usr/bin/env bash
cat <<EOF | clang++ -xc++ - -c -o string.o
template <class T>
struct basic_string {
__attribute__((internal_linkage))
void shrink_to_fit();
};
template <class T>
@htr3n
htr3n / macos-ramdisk.md
Last active July 18, 2024 08:22
Creating RAM disk in macOS

Built-in

diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`

where XXXXX is the size of the RAM disk in terms of memory blocks.

Notes:

@joshtch
joshtch / gdrive-dl.py
Created January 4, 2018 02:02
Google Drive file downloader for Python, with progress bar with tqdm. Based on this SO answer https://stackoverflow.com/a/39225039/3175094
#!/usr/bin/env python2
import requests
from tqdm import tqdm
import re
import os
def download_file_from_google_drive(id, destination):
URL = 'https://docs.google.com/uc?export=download'
session = requests.Session()
@BlakeGardner
BlakeGardner / install nano.sh
Last active July 8, 2024 03:56
Syntax highlighting in nano on Mac OS
# Last updated May, 2024 for Apple silicon Macs
# Install Homebrew if you don't already have it: https://brew.sh
# install nano from homebrew
brew install nano nanorc
# update your nanorc file
echo 'include "'"$(brew --cellar nano)"'/*/share/nano/*.nanorc"' >> ~/.nanorc
# close and re-open your terminal and you'll have syntax highlighting
@corydolphin
corydolphin / mailmanToMBox.py
Created February 3, 2012 06:57
Convert Mailman archive to text and mbox formatted archives.
#!/usr/bin/env python
"""
mailmanToMBox.py: Inserts line feeds to create mbox format from Mailman Gzip'd
Text archives
Usage: ./to-mbox.py dir
Where dir is a directory containing .txt.gz files pulled from mailman Gzip'd Text
"""
import sys
import os
def makeMBox(fIn,fOut):