Skip to content

Instantly share code, notes, and snippets.

View glyh's full-sized avatar
🦎
Made with LISP

Yihang Liu glyh

🦎
Made with LISP
View GitHub Profile
@steinwaywhw
steinwaywhw / reg-exp-fn.sml.md
Created September 13, 2015 23:55
A Copy of ml-ulex Source Code

I pasted it here because it is hard to find for me. It is publicly available at here. The total order and canonical form is clearly presented here over the original ml-ulex paper.

(* reg-exp-fn.sml
 *
 * COPYRIGHT (c) 2005 
 * John Reppy (http://www.cs.uchicago.edu/~jhr)
 * Aaron Turon (adrassi@gmail.com)
 * All rights reserved.
@vadimkantorov
vadimkantorov / debug_repl.lua
Last active January 3, 2022 15:41
A Lua repl that copies local variables onto globals for inspection
local torch_repl = repl
function repl(restoreGlobals)
-- copied from http://stackoverflow.com/questions/33068607/how-can-i-use-the-torch-repl-for-debugging
require 'trepl'
restoreGlobals = restoreGlobals or false
-- optionally make a shallow copy of _G
local oldG = {}
if restoreGlobals then
@matthewaveryusa
matthewaveryusa / grab_io_kbm.c
Created May 20, 2016 03:13
linux grab io from keyboard and mouse
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <linux/input.h>
#include <time.h>
#include <stdint.h>
int main(int argc, char* argv[]){
sleep(1);
@zehnpaard
zehnpaard / simple-hiccup.core.clj
Last active March 25, 2023 02:04
Simple Ring/Compojure/Hiccup Demo
(ns simple-hiccup.core
(require
[ring.adapter.jetty :refer [run-jetty]]
[simple-hiccup.middleware :as m]
[simple-hiccup.routes :as r]
))
(def app
(-> r/routes
m/logger
@zacharycarter
zacharycarter / wclwn.md
Last active July 6, 2024 06:26
Binding to C Libraries with Nim
@aslafy-z
aslafy-z / howto-hearthstone-archlinux.md
Last active November 4, 2022 11:17
Install Hearthstone on Archlinux

Dependencies

Installation

  • Open PlayOnLinux
@dentechy
dentechy / WSL-ssh-server.md
Last active July 14, 2024 03:54
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
@t184256
t184256 / example_remap.py
Created January 19, 2018 03:26
A thoroughly annotated example on keyboard remapping with evdev/uinput.
#!/usr/bin/python3
# CC0, originally written by t184256.
# This is an example Python program for Linux that remaps a keyboard.
# The events (key presses releases and repeats), are captured with evdev,
# and then injected back with uinput.
# This approach should work in X, Wayland, anywhere!
@pinge
pinge / iphone.ubuntu.md
Last active June 14, 2023 07:21
mounting iPhone storage in Ubuntu 16.04 LTS

mounting iPhone storage in Ubuntu 16.04 LTS

check if your device was recognized correctly

$ dmesg | grep ipheth
[62051.385352] ipheth 1-5:4.2: Apple iPhone USB Ethernet device attached
[62051.385437] usbcore: registered new interface driver ipheth

create mounting point and make it writable (optional)

@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active July 26, 2024 08:06
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized