Skip to content

Instantly share code, notes, and snippets.

View TheWaWaR's full-sized avatar
🌀
Focusing

LingFeng TheWaWaR

🌀
Focusing
View GitHub Profile
@TheWaWaR
TheWaWaR / README.md
Created September 2, 2022 08:26 — forked from josephg/README.md
Getting Zig compiling to WASM

In case anyone else wants to play with Zig on webassembly, here's what you need to do to make it work on a mac today.

1. Get LLVM 7 compiled with webassembly support.

You'll need LLVM to output to the WASM target. This has just been added by default in trunk, so if LLVM >7 is available, you might be able to just brew install llvm.

If you have wasm support already you should see:

$ llc --version
@TheWaWaR
TheWaWaR / README.md
Created September 2, 2022 08:26 — forked from josephg/README.md
Getting Zig compiling to WASM

In case anyone else wants to play with Zig on webassembly, here's what you need to do to make it work on a mac today.

1. Get LLVM 7 compiled with webassembly support.

You'll need LLVM to output to the WASM target. This has just been added by default in trunk, so if LLVM >7 is available, you might be able to just brew install llvm.

If you have wasm support already you should see:

$ llc --version
@TheWaWaR
TheWaWaR / gist:373250e00f004d551872ba73556f84c8
Created May 17, 2016 07:55 — forked from danaspiegel/gist:3105761
Git pre-commit hook to check pep8 and pyflakes
#!/usr/bin/python
# borrowed from https://github.com/lbolla/dotfiles/blob/master/githooks/pre-commit
import os
import sys
import re
import subprocess
@TheWaWaR
TheWaWaR / supervisord.sh
Last active October 23, 2015 07:12 — forked from danmackinlay/supervisord.sh
An init.d script for supervisord >> $ sudo update-rc.d supervisord defaults
#!/bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
from geventwebsocket.handler import WebSocketHandler
from gevent.pywsgi import WSGIServer
from flask import Flask, request, render_template
app = Flask(__name__)
app.debug = True
@app.route('/')
def index():
return render_template('index.html')
@TheWaWaR
TheWaWaR / install_jdk7.sh
Last active December 24, 2015 18:09 — forked from ralph-tice/gist:4252866
Install JDK7 in Linux.
#download the JDK
#oracle's rpm.bin gets pulled down as corrupt..zzz
#wget --no-cookies --header "Cookie: gpw_e24=xxx" "http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64-rpm.bin" -O jdk-7-linux-x64-rpm.bin
#updated for version 7u11
wget --no-check-certificate --no-cookies --header "Cookie: gpw_e24=xxx" http://download.oracle.com/otn-pub/java/jdk/7u11-b21/jdk-7u11-linux-x64.rpm -O jdk-7u11-linux-x64.rpm
sudo rpm -ivh jdk-7u11-linux-x64.rpm
sudo alternatives --install /usr/bin/java java /usr/java/default/bin/java 20000
@TheWaWaR
TheWaWaR / nested_list.qml
Last active December 21, 2015 00:38 — forked from elpuri/gist:3753756
A collapsible nested list example in QML
import QtQuick 1.1
Item {
width: 200
height: 300
ListView {
anchors.fill: parent
model: nestedModel
delegate: categoryDelegate
@TheWaWaR
TheWaWaR / upload-as-static-folder.py
Last active December 19, 2015 04:39 — forked from rduplain/app.py
Add *upload* folder as static file folder.
import os
from flask import Flask, send_from_directory
app = Flask(__name__)
@app.route('/upload/<path:filename>')
def send_uploads(filename):
print filename
return send_from_directory(os.path.join(app.root_path, 'upload'), filename)
@TheWaWaR
TheWaWaR / arch_install.sh
Last active December 10, 2015 01:48 — forked from anonymous/arch_install
Arch install Script
passwd
systemctl enable sshd.service
systemctl start sshd.service
parted -s /dev/sda mklabel gpt
parted -s /dev/sda mkpart "primary" "fat16" "50MB" "60MB"
parted -s /dev/sda mkpart "primary" "ext4" "1%" "99%"
parted -s /dev/sda set 1 bios_grub on
mkfs.ext4 /dev/sda2