Skip to content

Instantly share code, notes, and snippets.

Avatar
🐈
Cataholic

Ash Wu hSATAC

🐈
Cataholic
View GitHub Profile
View Electron on WSL2.md

Electron is tricky to get set up on Windows Subsystem for Linux, but it can work!

Four things needed overall:

  1. you need WSL2, not WSL1
  2. you need node, of course, and that part isn't so bad
  3. you need to apt install several dependencies
  4. you need an X Server so it can display the electron GUI over in Windows-land

Setup instructions, in order:

@thiagoghisi
thiagoghisi / bluetooth-restart.sh
Created Jul 7, 2019
Script for Mac OSX to Restart Bluetooth service & Reconnect all recently paired devices
View bluetooth-restart.sh
#!/bin/bash
echo "Restarting bluetooth service..."
blueutil -p 0 && sleep 1 && blueutil -p 1
echo "Waiting bluetooth service to be restored..."
until blueutil -p | grep "1" >/dev/null; do sleep 1; done
echo "Searching for devices not connected..."
devices=($(blueutil --paired | grep "not connected" | awk -F '[ ,]' '{print $2}'))
@emilianavt
emilianavt / VRM.md
Last active Jul 28, 2022
Converting an avatar to VRM format
View VRM.md

Converting an avatar to VRM format

In this guide, I assume you already know the basics of Unity and probably have previously uploaded an avatar to VRChat. If you haven't, you can still try to follow along, but some descriptions might be a bit too brief.

A more in-depth guide with screenshots can be found here.


Setup

@xinzweb
xinzweb / tmate-slave-ubuntu-1604.md
Last active Jan 18, 2019 — forked from mego22/tmate-slave-ubuntu-1604.md
Tmate-slave on Ubuntu 16.04
View tmate-slave-ubuntu-1604.md

Install dependincies

apt-get install  git-core build-essential pkg-config libtool libevent-dev libncurses-dev zlib1g-dev automake libssh-dev cmake ruby

Install msgpack >= 1.2.0

git clone https://github.com/msgpack/msgpack-c.git
cd msgpack-c
cmake .
@yuanying
yuanying / kubectl-run-with-pvc.sh
Last active Jun 24, 2022
kubectl run with PVCs
View kubectl-run-with-pvc.sh
#!/bin/bash
IMAGE="gcr.io/google-containers/ubuntu-slim:0.14"
COMMAND="/bin/bash"
SUFFIX=$(date +%s | shasum | base64 | fold -w 10 | head -1 | tr '[:upper:]' '[:lower:]')
usage_exit() {
echo "Usage: $0 [-c command] [-i image] PVC ..." 1>&2
exit 1
}
@benjisg
benjisg / echo_server.go
Last active Jul 24, 2022
Simple GO HTTP server to pretty print the request body sent to it
View echo_server.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
@ivan-loh
ivan-loh / README.md
Last active Feb 8, 2021
netcat tcp proxy, for mapping ports on a remote machine to a local machine
View README.md

Helper script to map ports to other servers.

Use Case

had a database that was only accesible in the VPC on aws, so i created an dev intance and did a ssh tunnel to that dev instance with netcat mapping the port to the database

Sample Usage

Forward all request from local 5432 to remote host google.com port 80

./nc-proxy.sh 5432 google.com 80
@mattes
mattes / boot2docker-nfs.rb
Last active Jul 28, 2020
docker-machine/ boot2docker with NFS instead of vboxsf
View boot2docker-nfs.rb
#!/usr/bin/env ruby
# Usage
# $ docker-machine create my-machine123 -d virtualbox
# $ ruby <(curl -L https://git.io/vvvco) my-machine123
# https://gist.github.com/mattes/4d7f435d759ca2581347
require 'erb'
bootlocalsh = %Q(#/bin/bash
@O-I
O-I / hash_except.md
Last active Jan 1, 2021
[TIx 4] Remove key-value pairs from a hash and return the hash
View hash_except.md

Note: As of Ruby 3.0.0, Hash#except is now [part][1] of the language. However, Ruby does not implement Hash#except!.

Sometimes I want to remove a specific key-value pair from a Ruby hash and get the resulting hash back. If you're using Rails or ActiveSupport you can accomplish this using Hash#except:

hash = { a: 1, b: 2, c: 3 }
hash.except(:a)     # => { b: 2, c: 3 }

# note, the original hash is not modified
hash # =&gt; { a: 1, b: 2, c: 3 }
@nateberkopec
nateberkopec / gist:11dbcf0ee7f2c08450ea
Last active Jun 29, 2020
RubySpec is dead, long live RubySpec!
View gist:11dbcf0ee7f2c08450ea

Last night, Brian Shirai unilaterally "ended" the RubySpec project, a sub-project of Rubinius (the alternative Ruby implementation which Brian was paid to work on full-time from 2007 to 2013). The blog post describing his reasons for "ending" the project led to a big discussion on Hacker News.

When a single, competing Ruby implementation tells that you its test suite is the One True Way, you should be skeptical. Charles Nutter, Ruby core committer and JRuby head honcho, spent a lot of time last night on Twitter talking to people about what this decision means. He's probably too busy and certainly too nice of a guy to write about what is a political issue in the Ruby community, so I'm going to do it on behalf of all the new or intermediate Rubyists out there that are confused by Brian's decision and what it me