Skip to content

Instantly share code, notes, and snippets.

@jsambuo
jsambuo / debian-install-script.sh
Last active March 11, 2022 17:10
Debian 11 Install
#!/bin/bash
# Jimmy's Debian 11 install script
# To run, execute this:
# /bin/bash -c "$(curl -fsSL https://gist.githubusercontent.com/jsambuo/3844b707d6296c8f6aa2425b22ec6fd7/raw/a3928c7d10a59834841acb38d80eb8fc3a021a70/debian-install-script.sh)"
# Virtualbox Guest Additions
echo "deb http://ftp.debian.org/debian bullseye-backports main contrib" | sudo tee /etc/apt/sources.list.d/bullseye-backports.list
sudo apt update
sudo apt install fasttrack-archive-keyring
@jsambuo
jsambuo / keybase.md
Created December 28, 2017 11:08
Keybase proof

Keybase proof

I hereby claim:

  • I am jsambuo on github.
  • I am jsambuo (https://keybase.io/jsambuo) on keybase.
  • I have a public key ASDbAwvTwgMyZUEIpcoQhSlqic52hos0u2zJRkT9qTikHAo

To claim this, I am signing this object:

@jsambuo
jsambuo / shoes.sh
Created July 8, 2017 18:59
Script to check if shoes in stock every five minutes. Stops and opens the page when they are in stock.
#!/usr/bin/env bash
while true; do
IN_STOCK=`curl -s http://store.nike.com/us/en_us/pd/nikelab-acg7kmtr-mens-shoe/pid-11456123/pgid-11883018 | grep 'ADD TO CART' | wc -l`
if [ $IN_STOCK -ne 0 ]; then
open http://store.nike.com/us/en_us/pd/nikelab-acg7kmtr-mens-shoe/pid-11456123/pgid-11883018
break
else
echo `date "+%H:%M:%S"`': Not in stock'
fi
@jsambuo
jsambuo / grep.sh
Last active August 29, 2015 14:24
Grep
# Search for "TODO" in all Swift and Objective-C files that are not in Pods
grep --include=\*.{swift,m,h} --exclude=\*Pods\* "TODO" -rn .
# Search for semicolons in Swift files
grep --include=\*.swift -E ";$" -rn .
# Search for tabs in all Swift and Objective-C files that are not in Pods
grep --include=\*.{swift,m,h} --exclude=\*Pods\* "\t" -rn .
# Search for misplaced elements in all storyboard and xibs

The easiest way to start using the LLVM C++ API by example is to have LLVM generate the API usage for a given code sample. In this example it will emit the code required to rebuild the test.c sample by using LLVM:

$ clang -c -emit-llvm test.c -o test.ll
$ llc -march=cpp test.ll -o test.cpp