Skip to content

Instantly share code, notes, and snippets.

View chawyehsu's full-sized avatar
☯️
no silver bullet

Chawye Hsu chawyehsu

☯️
no silver bullet
View GitHub Profile
@tancnle
tancnle / patch_font.sh
Last active December 11, 2015 02:08
Font patching for Vim
brew install fontforge
mkdir ~/.fonts
wget -P ~/.fonts https://gist.github.com/baopham/1838072/raw/5fa73caa4af86285f11539a6b4b6c26cfca2c04b/Monaco%20for%20Powerline.otf
git clone https://github.com/Lokaltog/vim-powerline.git /tmp/vim-powerline
cd /tmp/vim-powerline && fontforge -script fontpatcher/fontpatcher ~/.fonts/Monaco+for+Powerline.otf
echo -e "set encoding=utf-8\nset guifont=Monaco-Powerline\nlet g:Powerline_symbols = 'fancy'" >> ~/.vimrc
# And make sure you install Monaco-Powerline.otf on Mac and use that font for your Terminal/iTerm app as well
IMPORTANT
Please duplicate this radar for a Safari fix!
This will clean up a 50-line workaround.
rdar://22376037 (https://openradar.appspot.com/radar?id=4965070979203072)
//////////////////////////////////////////////////////////////////////////////
(Now available as a standalone repo.)
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active June 10, 2024 15:37
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@XVilka
XVilka / TrueColour.md
Last active July 9, 2024 23:28
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

测试平台:DigitalOcean VPS ubuntu14.04 x64, strongswan5.2.2

运行以下命令请使用root权限

一:安装strongswan

由于ubuntu软件仓库中strongswan版本较低,因此从官网源码编译安装

apt-get install build-essential     #编译环境
aptitude install libgmp10 libgmp3-dev libssl-dev pkg-config libpcsclite-dev libpam0g-dev     #编译所需要的软件
@ck-on
ck-on / hhvminfo.php
Last active September 18, 2022 05:44
HHVMinfo - phpinfo for HHVM HipHop Virtual Machine
<?php
/*
HHVMinfo - phpinfo page for HHVM HipHop Virtual Machine
Author: _ck_
License: WTFPL, free for any kind of use or modification, I am not responsible for anything, please share your improvements
Version: 0.0.6
* revision history
0.0.6 2014-08-02 display fix for empty vs zero
0.0.5 2014-07-31 try to determine config file from process command line (may not always work), style improvements
@framer99
framer99 / msys2cleanreinstallall.txt
Created September 10, 2014 18:20
msys2 all packages clean reinstall
$ pacman -S $(pacman -Q | awk '{print $1}')
warning: bash-4.3.024-1 is up to date -- reinstalling
warning: bash-completion-2.1-3 is up to date -- reinstalling
warning: bsdcpio-3.1.2-3 is up to date -- reinstalling
warning: bsdtar-3.1.2-3 is up to date -- reinstalling
warning: bzip2-1.0.6-1 is up to date -- reinstalling
warning: ca-certificates-20140325-1 is up to date -- reinstalling
warning: catgets-1.1-1 is up to date -- reinstalling
warning: coreutils-8.23-2 is up to date -- reinstalling
warning: crypt-1.1-2 is up to date -- reinstalling
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@gsitgithub
gsitgithub / Java SE JDK Download archive links
Created August 11, 2016 06:32
JDK archive direct download links

Mobile Safari's 100% Height Dilemma

Whether you're developing a web application with native-ish UI, or just a simple modal popup overlay that covers the viewport, when it comes to making things work on iDevices in Mobile Safari, you're in for a decent amount of pain and suffering. Making something "100% height" is not as easy as it seems.

This post is a collection of Mobile Safari's gotchas and quirks on that topic, some with solutions and fixes, some without, in good parts pulled from various sources across the internets, to have it all in one place. Things discussed here apply to iOS8, iOS9 and iOS10.

The Disappearing Browser Chrome

Screen real estate on smartphones is limited, so Mobile Safari collapses the browser chrome (address bar and optional tab bar at the top, and tool bar at the bottom) when the user scrolls down. When you want to make something span exactly the height of the viewport, or pin something to the bottom of the screen, this can get tricky because the viewport changes size (or