Skip to content

Instantly share code, notes, and snippets.

View Ouroboros's full-sized avatar

Ouroboros

  • 身喰らう蛇
  • 星辰の間
View GitHub Profile
@peterhellberg
peterhellberg / api.go
Last active January 18, 2019 01:58
A tiny example API written in Go using Martini and Redigo
package main
import (
"flag"
"fmt"
"net/http"
"github.com/codegangsta/martini"
"github.com/garyburd/redigo/redis"
"github.com/martini-contrib/render"
#include <substrate.h>
#include <mach/mach.h>
#include <mach/mach_time.h>
#include <IOKit/hid/IOHIDEventTypes.h>
#include <IOKit/hidsystem/IOHIDUsageTables.h>
#include <GraphicsServices/GraphicsServices.h>
@application2000
application2000 / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active May 23, 2024 07:53
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@cyrex562
cyrex562 / OpenVPNInstallUbuntu1604
Created November 27, 2016 15:58
Install OpenVPN stable latest on Ubuntu 16.04 using the OpenVPN.net official APT repository.
wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg|apt-key add -
echo "deb http://build.openvpn.net/debian/openvpn/stable xenial main" > /etc/apt/sources.list.d/openvpn-aptrepo.list
apt -y update && apt -y install openvpn easy-rsa
'''
Break on Objective-C 's method using its address'
'''
import shlex
import lldb
import re
def breakonmethod(debugger, command, exe_ctx,result, internal_dict):
args=shlex.split(command)
Class=args[0]
Method=args[1]
ln -s /usr/lib/llvm-6.0/lld /usr/lib/llvm-6.0/ld
CC=/usr/lib/llvm-6.0/bin/clang CXX=/usr/lib/llvm-6.0/bin/clang++ cmake -DCMAKE_BUILD_TYPE=Release -G Ninja ../LLVM
# NOTE: This is mostly code from flame of heroesoflegend.org; I only ported it to Python 3
# Better code have been released since then; see Trails Research Group: https://github.com/Trails-Research-Group
#v2.1: Bug fix in FALCOM3 compression
#v2: Full implementation of FALCOM2 for better compression performance and
# implement chunking for FALCOM3
import struct
import io
import pdb
import sys
from functools import partial
@andrewcourtice
andrewcourtice / task.ts
Last active April 21, 2024 09:08
Async cancellation using promise extension and abort controller
/*
This a basic implementation of task cancellation using a Promise extension
combined with an AbortController. There are 3 major benefits to this implementation:
1. Because it's just an extension of a Promise the Task is fully
compatible with the async/await syntax.
2. By using the abort controller as a native cancellation token
fetch requests and certain DOM operations can be cancelled inside the task.
3. By passing the controller from parent tasks to new child tasks an entire
async chain can be cancelled using a single AbortController.
# We have moved! https://github.com/uyjulian/unpackpkg