Skip to content

Instantly share code, notes, and snippets.

@binji
binji / notes.md
Created November 25, 2022 05:14
Compiling LLVM/Clang for Wasm notes
  • How to Cross Compile LLVM: https://llvm.org/docs/HowToCrossCompileLLVM.html
  • Building LLVM with CMake: https://llvm.org/docs/CMake.html
  • Hints from wasi-sdk Makefile: https://github.com/CraneStation/wasi-sdk/blob/master/Makefile
  • Try compiling natively (needed for llvm-tblgen and clang-tblgen)
    • cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86;WebAssembly" -DLLVM_ENABLE_PROJECTS="lld;clang" ../llvm
  • Try building LLVM with WASI:
  • cmake -G Ninja -DCMAKE_AR=”/usr/local/google/home/binji/dev/llvm-project/build/bin/llvm-ar” -DCMAKE_RANLIB=”/usr/local/google/home/binji/dev/llvm-project/build/bin/llvm-ranlib” -DCMAKE_C_COMPILER="/usr/local/google/home/binji/dev/wasi-sdk-5.0/opt/wasi-sdk/bin/clang" -DCMAKE_CXX_COMPILER="/usr/local/google/home/binji/dev/wasi-sdk-5.0/opt/wasi-sdk/bin/clang++" -DCMAKE_CROSSCOMPILING=True -DCMAKE_INSTALL_PREFIX=/usr/local/google/home/binji/dev/wasi-clang -DLLVM_TABLEGEN=/usr/local/google/home/binji/dev/llvm-project/build/bin/llvm-tblgen -DCLANG_TABLEGEN=/
@hartsick
hartsick / masto-guide-for-friends.md
Last active April 6, 2023 19:39
My tips for friends thinking of joining Mastodon

A guide for friends considering Mastodon

A lot of my friends have recently been considering leaving Twitter for other networks, and many are considering Mastodon. There are many guides floating about that can tell you about Mastodon and the Fediverse, which is really exciting! It can be overwhelming to sort through them all, though, and honestly I haven't read them since I know my way around.

So, this is the blog version of me sitting down with a friend explaining what I know about Mastodon and how I'd recommend approaching setting up an account there for the first time and getting oriented.

What's in this:

  1. What is the Fediverse / Mastodon?
  2. Why would I want to join?
  3. Where do I start?
@the6p4c
the6p4c / cursed.c
Created August 27, 2020 02:23
hey! don't do this!
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/io.h>
#include <sys/mman.h>
#include "elf.h"
@marysaka
marysaka / pleroma_on_steamlink.md
Created November 16, 2017 12:30
Pleroma on the Steam Link
@kylemcdonald
kylemcdonald / CameraImage.cpp
Created November 23, 2015 15:30
openFrameworks app for sending images to disk for processing, and reading text back from disk. Used for "NeuralTalk and Walk".
#include "ofMain.h"
#include "ofxTiming.h"
class ofApp : public ofBaseApp {
public:
ofVideoGrabber grabber;
DelayTimer delay;
ofTrueTypeFont font;
string description;
@pendingchaos
pendingchaos / README.md
Last active October 13, 2015 20:05
The most awesome arm printer.

Awesome Arms v1.0.0

Animation

Usage:

awesomearms <the number of lines of awesome arms>

Or:

You're sitting at your desk,
coding away with no rest.
Many little things to fix.
Did you know asie likes unix?
Stuck inside a loop, no break in sight.
Looks like I'll be staying up all night.
Though I'm already tired, it feels like I'm wired.
@Michcioperz
Michcioperz / gist:a514531d6f897e19ba94
Created October 29, 2014 14:26
1D pong on atmega8 (WIP)
#include <avr/io.h>
#include <avr/interrupt.h>
int dir = 0;
int main() {
TIMSK |= (1<<TOIE0);
DDRD = (1<<PD3);
PORTD |= (1<<PD3) | (1<<PD2);
MCUCR |= (1<<ISC11);
@Qard
Qard / scripts.json
Created February 17, 2014 03:51
This would be several hundred lines in grunt.
{
"start": "node --harmony server.js",
"dev": "exec-parallel 'npm run watch' 'npm run watch:test' 'nodemon --harmony server.js'",
"test": "mocha --harmony",
"coverage": "npm run coverage:report",
"coverage:build": "rm -rf coverage && node --harmony istanbul cover _mocha",
"coverage:report": "npm run coverage:build && istanbul report",
"coverage:html": "npm run coverage && node-open coverage/lcov-report/index.html",
"build": "exec-parallel 'npm run build:js' 'npm run build:css'",
"build:js": "browserify assets/js/main.js -o public/js/bundle.js",
@sk89q
sk89q / lastfm_scrobbles_to_spotify.py
Created October 26, 2013 19:44
Fetches the recent tracks of a last.fm user within a date range and converts it to a list of Spotify URLs (to be copied directly into the Spotify program) sorted descending by play count
#!/usr/bin/env python2.7
import requests
import datetime
import calendar
import time
import json
from pprint import pprint