Skip to content

Instantly share code, notes, and snippets.

View liweiyap's full-sized avatar
🌹
Roses are red, violets are blue. Segmentation fault on line 32.

Li-Wei Yap liweiyap

🌹
Roses are red, violets are blue. Segmentation fault on line 32.
View GitHub Profile
Computer Information:
Manufacturer: Apple
Model: MacBookPro17,1
Form Factor: Laptop
No Touch Input Detected
Processor Information:
CPU Vendor: VirtualApple
CPU Brand: Apple M1
CPU Family: 0x6
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: dota2 [11152]
Path: /Users/USER/Library/Application Support/Steam/*/dota2.app/Contents/MacOS/dota2
Identifier: com.valvesoftware.dota2
Version: 1.0.0
Code Type: X86-64 (Translated)
Parent Process: Exited process [11149]
@liweiyap
liweiyap / vectoriseImages.sh
Last active September 22, 2020 11:05
Script to vectorise images on Linux OS using Potrace. Use cases include scanned pages. Reduces image file size 👍.
#!/bin/bash
# exit immediately when:
# - a command fails
# - undeclared variables are used
set -o errexit -o nounset
# error codes
OS_ERR=1
GETOPT_FAIL=2
@liweiyap
liweiyap / graph.cpp
Last active February 4, 2020 16:24
Non-directed graph representing clusters of different genes
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <stack>
#include <cassert>
template <typename T>
void print_vector(const std::vector<T>& vec)
{