Skip to content

Instantly share code, notes, and snippets.

View cyrilis's full-sized avatar
😕
Confusing...

Cyril Hou cyrilis

😕
Confusing...
View GitHub Profile
@cyrilis
cyrilis / StringHelper.swift
Created April 12, 2016 01:28
Swift String substring
extension String {
subscript (r: Range<Int>) -> String {
get {
let startIndex = self.startIndex.advancedBy(r.startIndex)
let endIndex = startIndex.advancedBy(r.endIndex - r.startIndex)
return self[Range(start: startIndex, end: endIndex)]
}
}
func substring(from: Int) -> String {
let end = self.characters.count
@cyrilis
cyrilis / port-forwarding.sh
Created May 19, 2016 18:56
Port Forwarding
#!/bin/bash
for ((i=1;i<=$#;i++));
do
if [ ${!i} = "-from" ]
then ((i++))
from=${!i};
elif [ ${!i} = "-login" ];
then ((i++))
@cyrilis
cyrilis / README.md
Last active February 19, 2023 12:45
Take a selfie every time you git commit

Take a selfie every time you git commit

本文仅写了 macOS 下的实践, 其他系统可参照修改。

通过 homebrew 安装 imagesnap:

brew install imagesnap
swagger: '2.0'
info:
title: COE API
description: COE Project API, make repentance great again.
version: 1.0.0
host: api.coe.devops.dataengine.com
schemes:
- http
basePath: '/'
produces:
@cyrilis
cyrilis / test.html
Last active February 14, 2019 01:16
test.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="MoonLite is a UI component library based on Vue 2.0">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="https://avatars0.githubusercontent.com/u/1834189">
<title>MoonLite</title>
</head>
@cyrilis
cyrilis / README.md
Last active March 7, 2019 12:40
Github Reader CJS
@cyrilis
cyrilis / Activate Office 2019 for macOS VoL.md
Created May 6, 2020 08:46 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref