Skip to content

Instantly share code, notes, and snippets.

View HillLiu's full-sized avatar
🍻
Focusing 🐵

Hill Liu HillLiu

🍻
Focusing 🐵
View GitHub Profile
@austinhyde
austinhyde / LICENSE
Last active June 5, 2020 12:23
3D Bar Chart
Copyright 2020 Austin Hyde
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
@54chi
54chi / Making it work for Mac OS.md
Last active July 15, 2021 20:06
LG UltraWide settings

How to create a 1280x1080 (among others) scaled resolutions for your non-standard monitor

Ultrawide monitors with PBP (Picture by Picture) are becoming more common these days. It allows you to split the screen and connect multiple sources to your monitor (e.g. 2 computers at the same time)

The problem is that the resolution is typically not supported out of the box (E.g. a 2560x1080 monitor, when split into 2 will require a 1280x1080 resolution, which is not standard in Mac OS as of Sierra)

Creating custom resolutions

First, we have to reboot in rootless mode, and disable the Integrity Protection, so we can create/override the screen file settings:

@codepo8
codepo8 / 7devsecrets.md
Last active November 16, 2021 13:36
Resources for the "7 Developer Tools secrets that shouldn't be secrets" talks
@jmervine
jmervine / 01_nginx.conf
Last active November 27, 2021 16:04
Nginx Based A/B testing.
worker_processes 1;
events {
worker_connections 1024;
}
http {
include /home/t/nginx/conf/mime.types;
default_type application/octet-stream;
@oanhnn
oanhnn / how_to.md
Created May 14, 2017 16:47
How to fix composer error "Content-Length Mismatch"

First, run:

$ composer config --list --global        //this will get the composer home path.
[home] /root/.composer                   //it's my composer home path.

And then, edit the config.json in [home] directory, make it like this:

{
  "config": {
 "github-protocols": [
@kristopherjohnson
kristopherjohnson / react-formatjson.html
Last active April 7, 2023 15:35
JSON Formatter using ReactJS
<!doctype html>
<html lang="en">
<head>
<title>JSON Formatter</title>
<script src="//fb.me/react-0.12.2.min.js"></script>
<script src="//fb.me/JSXTransformer-0.12.2.js"></script>
<link href='//fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Source+Code+Pro' rel='stylesheet' type='text/css'>
@vstoykov
vstoykov / force_default_language_middleware.py
Last active August 8, 2023 08:24
Force Django to use settings.LANGUAGE_CODE for default language instead of request.META['HTTP_ACCEPT_LANGUAGE']
try:
from django.utils.deprecation import MiddlewareMixin
except ImportError:
MiddlewareMixin = object
class ForceDefaultLanguageMiddleware(MiddlewareMixin):
"""
Ignore Accept-Language HTTP headers
@piedpiperRichard
piedpiperRichard / content.js
Last active August 26, 2023 13:03
Web developer 0.4.9 tools hacked and installing adware Decode
function md5cycle(x, k) {
var a = x[0], b = x[1], c = x[2], d = x[3];
a = ff(a, b, c, d, k[0], 7, -680876936);
d = ff(d, a, b, c, k[1], 12, -389564586);
c = ff(c, d, a, b, k[2], 17, 606105819);
b = ff(b, c, d, a, k[3], 22, -1044525330);
a = ff(a, b, c, d, k[4], 7, -176418897);
d = ff(d, a, b, c, k[5], 12, 1200080426);
c = ff(c, d, a, b, k[6], 17, -1473231341);
@carcinocron
carcinocron / debugger pause beforeunload
Last active January 4, 2024 14:14
Chrome: pause before redirect
// Run this in the F12 javascript console in chrome
// if a redirect happens, the page will pause
// this helps because chrome's network tab's
// "preserve log" seems to technically preserve the log
// but you can't actually LOOK at it...
// also the "replay xhr" feature does not work after reload
// even if you "preserve log".
window.addEventListener("beforeunload", function() { debugger; }, false)
@cortesben
cortesben / hg-commands.md
Last active January 9, 2024 14:53
Mercurial command cheat sheet

Mercurial Commands

Commands Description
hg pull get latest changes like git pull use flags like -u IDK why yet
hg add only for new files
hg commit add changes to commit with -m for message just like git
hg addremove adds new files and removes file not in your file system
hg incoming see changes commited by others
hg outgoing see local commits