Skip to content

Instantly share code, notes, and snippets.

@ShaneQi
ShaneQi / .swiftlint.yml
Created February 27, 2019 15:17
swiftlint yml for interviewers
excluded:
- Pods
disabled_rules:
- line_length
- vertical_whitespace
- trailing_whitespace
- trailing_newline
- syntactic_sugar
- void_return
for i in $(seq -f "%02g" 1 8)
do
sim-omna 201811$i /Users/shane/Downloads/201811$i
done
$ ffmpeg -i in.mp4 -vf select='not(mod(n\,15))',setpts=N/FRAME_RATE/TB out.mp4
$ ssh -L 3305:MYSQL_CONTAINER_IP:3306 user@host
$ mysql -hlocalhost -P3305 -uroot -p
@ShaneQi
ShaneQi / pip.js
Created September 29, 2017 05:53
javascript:document.querySelector("video").webkitSetPresentationMode("picture-in-picture");
set tabstop=2

tabstop

The width of a hard tabstop measured in "spaces" -- effectively the (maximum) width of an actual tab character.

shiftwidth

func (rootViewControllesetr newRootViewController: UIViewController, withTransition transition: CATransition?) {
let previousViewController = ingredient.rootViewController
if let transition = transition {
// Add the transition
ingredient.layer.add(transition, forKey: kCATransition)
}
ingredient.rootViewController = newRootViewController
docker run -it --name certbot_certonly -p 80:80 -p 443:443 -v /etc/letsencrypt:/etc/letsencrypt certbot/certbot certonly
docker start -ia certbot_certonly
docker run --name cerbot_renew -p 80:80 -p 443:443 -v /etc/letsencrypt:/etc/letsencrypt certbot/certbot renew
docker start -ia cerbot_renew
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
echo "execute pathogen#infect()" >> ~/.vimrc
cd ~/.vim/bundle
git clone https://github.com/scrooloose/nerdtree.git
echo "au VimEnter * NERDTree" >> ~/.vimrc
class LocalDatabase {
private let pathUrl: URL
let persistentStoreCoordinator: NSPersistentStoreCoordinator
private init(fileName: String) {
pathUrl = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).last!
.appendingPathComponent(fileName + ".sqlite")
guard let model = NSManagedObjectModel.mergedModel(from: [Bundle.main])
else { fatalError() }