Skip to content

Instantly share code, notes, and snippets.

View yuchen's full-sized avatar
🌴
On vacation

clark yuchen

🌴
On vacation
  • china, shanghai
  • 17:49 (UTC +08:00)
View GitHub Profile
@oliveratgithub
oliveratgithub / Add as new Reminder.scpt
Last active February 21, 2019 10:23
Add selected Text as new Reminder in Reminders.app
on run {input, parameters}
-- This code comes from http://raduner.ch/blog/
-- To be used with an Automator Service
-- ------------------------------------------------
set inputText to input as string
tell application "Reminders"
set newremin to make new reminder
set name of newremin to inputText
end tell
@joelnet
joelnet / example.html
Created June 3, 2011 18:03
Unobtrusive Knockout support library for jQuery
Choose a ticket class: <select id="tickets"></select>
<p id="ticketOutput"></p>
<script id="ticketTemplate" type="text/x-jquery-tmpl">
{{if chosenTicket}}
You have chosen <b>${ chosenTicket().name }</b>
($${ chosenTicket().price })
<button data-bind="click: resetTicket">Clear</button>
{{/if}}
#!/bin/bash
# for: bulk merge bilibili UWP download file *.flv
# by: blog.502.li
# date: 2019-01-12
# 将该脚放到 UWP 客户端下载缓存主目录下执行,安装 ffmpeg、jq
set -xu
download_dir=$(pwd)
mp4_dir=${download_dir}/mp4
mkdir -p ${mp4_dir}
@jpillora
jpillora / client.go
Created February 27, 2015 05:44
Go Yamux Example
package main
import (
"fmt"
"log"
"net"
"time"
"github.com/hashicorp/yamux"
)
@dolmen
dolmen / README.md
Last active July 13, 2022 05:52
go-bin-upgrade

go-bin-upgrade

Rebuild the binaries you have built in Go module mode installed in $GOPATH/bin.

Usage: go-bin-upgrade [-n] [-v] bin1 [bin2]...

Examples:

  • go-bin-upgrade -n godoc
  • (cd ~/go/bin ; go-bin-upgrade * )
@justinbmeyer
justinbmeyer / jsmem.md
Last active August 19, 2022 04:50
JS Memory

JavaScript Code

var str = "hi";

Memory allocation:

Address Value Description
...... ...
@hackjutsu
hackjutsu / .leptonrc
Last active December 7, 2022 01:01
[Template for .leptonrc] This is a template for Lepton's configuration file. Please place it on your home directory. #lepton
{
"theme": "light",
"autoUpdate": false,
"snippet": {
"expanded": true,
"newSnippetPrivate": false,
"sorting": "updated_at",
"sortingReverse": true
},
"editor" : {
@MoOx
MoOx / README.md
Last active May 11, 2023 13:59
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily
@pjdietz
pjdietz / Virtual Box Host Only Static IP.md
Created June 12, 2013 19:01
VirtualBox Host-Only Adapter with Static IP

VirtualBox Host-Only Static IP

My typical setup for a development box in VirtualBox uses two NICs. The first uses NAT to allow the box to communicate with the outside world through my host computer’s network connection. (NAT is the default, so shouldn't require any setup.) The second is a "host-only" connection that allows my host and guest to interact.

To create a host-only connection in VirtualBox, start by opening the preferences in VirtualBox. Go to the "Network" tab, and addd a Host-only Network. Modify the host-only network, and disable DHCP. Make a note of the IP address. (Feel free to set the IP address as well, if you like.)

Next, assign this host-only adapter to the virtual machine. Select the VM and press "Settings". Go to the "Network" tab, and select "Adpater 2". Enable the adapter, set it to a "Host-only Adapter", and select the adpater you created above.

Temporary

摘译自 robots.thoughtbot.com

launchctl 命令加载,卸载开机自动运行的服务,在 OS X 中,服务本身存储在 .plist 文件中(即 property list),这些文件的位置一般在 ~/Library/LaunchAgents/Library/LaunchAgents。可以使用 launchctl load $PATH_TO_LISTunload them with launchctl unload $PATH_TO_LIST 命令来加载/卸载他们。加载就是允许这个程序开机执行,卸载反之。

如果你使用 Homebrew 安装过 mysql 那么下面的安装后提示你可能比较熟悉

To have launchd start mysql at login:
   ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
Then to load mysql now: