Skip to content

Instantly share code, notes, and snippets.

View liuyigh's full-sized avatar

Yi Liu liuyigh

View GitHub Profile
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<!-- Default system-ui fonts -->
<match target="pattern">
<test name="family">
<string>system-ui</string>
</test>
<edit name="family" mode="prepend" binding="strong">
@dvf
dvf / change-codec.md
Last active April 18, 2024 01:13
Enable High Quality mode on your headphones (Updated for macOS Catalina)

If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.

Find out what codec you're using

  1. Play a song on your headphones
  2. Option (⌥) click the Bluetooth button at the top of your screen Inspect the Bluetooth Coded
  3. If you're using AAC or aptX, you can stop here—those are the highest quality codecs.

Change your codec to AAC or aptX

@aenain
aenain / export-wunderlist-indexeddb.js
Created June 18, 2019 20:16
Wunderlist to Dynalist export. Go to Wunderlist web interface, backup data (JSON file), folders, list positions (from IndexedDB), use this script and import the output into Dynalist. Heavily inspired by https://gist.github.com/bryanph/fcddf602d60d7c6ecdaf6584f2db55a5
var download = (filename, text) => {
var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
element.setAttribute('download', filename);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
@BuhtigithuB
BuhtigithuB / update_web2py_specific_files_inside_your_app.sh
Last active January 17, 2018 23:15
Update web2py specific files inside your app
# When you upgrade web2py your should update app files that are important to web2py for properly functioning
#
# views/
# appadmin.html
# generic.ics
# generic.load
# generic.rss
# layout.html
# generic.json
# generic.map
@cunnie
cunnie / f1-micro-vs-g1-small.txt
Created August 31, 2016 22:13
g1-small is 2x faster than f1-micro
Compiling package 's3cli/1c5a91f02feff8a0e3a506ac51c4a3140e86f049'... Finished (00:00:04)
Compiling package 'ruby/589d4b05b422ac6c92ee7094fc2a402db1f2d731'... Finished (00:08:39)
Compiling package 'mysql/b7e73acc0bfe05f1c6cbfd97bf92d39b0d3155d5'... Finished (00:02:11)
Compiling package 'libpq/09c8f60b87c9bd41b37b0f62159c9d77163f52b8'... Finished (00:01:18)
Compiling package 'golang/1ad977ce1c6fdbf21485a79567ef3d8d4d280110'... Finished (00:03:05)
Compiling package 'powerdns/256336d00b1689138490c385c03ad3a8f54b4a9e'... Finished (00:00:10)
Compiling package 'director/0f1b09ec6bb28ea13d2e919e71dd7ccd8ab49313'... Finished (00:06:14)
Compiling package 'nats/0155cf6be0305c9f98ba2e9e2503cd72da7c05c3'... Finished (00:01:04)
Compiling package 'registry/3aa0993cb8739fd4f5c6fc1e0da8e1cfdf6df247'... Finished (00:06:20)
Compiling package 'bosh-google-cpi/22b47cafcd455cb8f94e164e2049a4976f4dce1c'... Finished (00:02:48)
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@jedisct1
jedisct1 / -
Created May 11, 2016 09:24
Make top look less ugly on Arch Linux
remove your ~/.toprc (if any)
start "top"
press z
press V
press 1
press y
press m m
press t t t
press W
@nepsilon
nepsilon / how-to-detach-process.md
Last active October 3, 2023 09:59
How to detach a process from the current terminal? — First published in fullweb.io issue #37

How to detach a process from the current terminal?

Closing the terminal will kill all processes launched from its shell instance that are still running. Here is how to detach a running process and run+detach a new process:

Scenario 1:

Let’s say we have ./long.sh running, and we want to detach it:

./long.sh
@QROkes
QROkes / nginx.conf
Last active September 26, 2023 16:41
NGINX Configuration for WordPress Multisite + Domain Mapping with HTTPS
server {
listen 80;
listen [::]:80;
server_name example.com www.example.com subsite.com www.subsite.com another.com www.another.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
@66Ton99
66Ton99 / logging_to_str.py
Created August 28, 2015 16:26
Capturing Python Log Output In A Variable
import logging
from StringIO import StringIO as StringBuffer
logger = logging.getLogger('basic_logger')
logger.setLevel(logging.DEBUG)
### Setup the console handler with a StringIO object
log_capture_string = StringBuffer()
# log_capture_string.encoding = 'cp1251'
ch = logging.StreamHandler(log_capture_string)