Skip to content

Instantly share code, notes, and snippets.

@KyonLi
KyonLi / FolioReaderCenter.swift
Created August 18, 2016 03:58
FolioReaderCenter.swift
func configureNavBar() {
let navBackground = isNight(readerConfig.nightModeMenuBackground, UIColor.whiteColor())
let tintColor = readerConfig.tintColor
let navText = isNight(UIColor.whiteColor(), UIColor.blackColor())
let font = UIFont(name: "Avenir-Light", size: 17)!
setTranslucentNavigation(color: navBackground, tintColor: tintColor, titleColor: navText, andFont: font)
if FolioReader.nightMode {
UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: true)
} else {
UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.Default, animated: true)
@KyonLi
KyonLi / gist:28dcb9a481173e7cf82980528b2440be
Last active January 21, 2019 08:23
nginx build config
./configure --prefix=/usr/share/nginx \
--sbin-path=/usr/sbin/nginx \
--modules-path=/usr/lib/nginx/modules \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/run/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--user=www-data \
--group=www-data \
@KyonLi
KyonLi / sae_rewrite.conf
Created August 31, 2015 07:21
Sina App Engine config for generate_204
- rewrite: if ( !is_dir() && !is_file() && path ~ "^generate_204$" ) goto "generate_204.php"
@KyonLi
KyonLi / ViewController.m
Created August 6, 2015 09:32
UITableViewCell remain highlighted
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
if (self.tableView.indexPathForSelectedRow) {
[self.tableView deselectRowAtIndexPath:self.tableView.indexPathForSelectedRow animated:animated];
}
}
@KyonLi
KyonLi / ocserv
Created December 2, 2014 09:10
ocserv init.d script
#!/bin/sh
### BEGIN INIT INFO
# Provides: ocserv
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
# Copyright Rene Mayrhofer, Gibraltar, 1999
# This script is distibuted under the GPL