Skip to content

Instantly share code, notes, and snippets.

@SunRunAway
SunRunAway / 获取字幕.workflow
Last active August 29, 2015 14:15
获取字幕.workflow
on run {input, parameters}
set SSCL to "~/bin/sscl"
set theList to input as list
set theLog to ""
do shell script "mkdir -p ~/Library/Application\\ Support/SPlayerX/SVPSub/"
do shell script "echo test > ~/Library/Application\\ Support/SPlayerX/SVPSub/README"
do shell script "mkdir -p ~/Library/Application\\ Support/SPlayerX/SVPSub.bak/"
do shell script "mv ~/Library/Application\\ Support/SPlayerX/SVPSub/* ~/Library/Application\\ Support/SPlayerX/SVPSub.bak/"
#do shell script "rm -rf ~/Library/Application\\ Support/SPlayerX/SVPSub/"
repeat with theItem in theList
@SunRunAway
SunRunAway / qiniusign.go
Last active August 29, 2015 14:17
sign a qiniu request
package main
import (
"flag"
"fmt"
"io"
"net/http"
"os"
"strings"
@SunRunAway
SunRunAway / git-pr
Created June 26, 2019 09:17
Use `git pr` to quickly send a pull request in browser.
#!/bin/bash
# put this file in your $PATH
# and chmod +x git-pr
# then use `git pr` in one github repo
repo=`git remote -v | grep push | grep origin | sed -e "s/.*github.com[:/]\(.*\)\.git.*/\1/"`
branch=`git name-rev --name-only HEAD`
echo "... creating pull request for branch \"$branch\" in \"$repo\""
open https://github.com/$repo/pull/new/$branch
@SunRunAway
SunRunAway / cherry_pick_pull.sh
Last active March 26, 2024 03:24
cherry_pick_pull.sh upstream/release-3.0 <pr number> //fork from https://github.com/kubernetes/kubernetes/blob/master/hack/cherry_pick_pull.sh
#!/usr/bin/env bash
# Copyright 2015 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@SunRunAway
SunRunAway / dump_profile.bash
Last active July 3, 2020 12:42
dump_profile.bash <pid> <status_port> <memory threshold(byte)>
#!/bin/bash
# usage:
# dump_profile.bash <pid> <db_port> <status_port> <memory threshold(byte)>
pid=$1
db_port=$2
status_port=$3
mem_threshold=$4