Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / 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 / 获取字幕.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
// ==UserScript==
// @name Google SSL Privacy Real Link
// @namespace http://userscripts.org/scripts/show/145014
// @description Mandatory use encryption connection https. Gets rid of almost every google tracking device. Disable the Google search rewrite, always showing and using the real, original, direct link URLs, also to prevent from using redirected pages that might be temporarily unavailable in some area.
// @include http://images.google.*/images*
// @include http://www.google.*/images*
// @include http://www.google.*/webhp*
// @include http://www.google.*/search?*
// @include http://www.google.*/imgres*
// @include http://images.google.*/search?*
@SunRunAway
SunRunAway / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@SunRunAway
SunRunAway / cheapest-steam.go
Last active August 29, 2015 13:59
cheapest-steam
/*
cheapest-steam
==============
A crawler to retrieve cheapest item price on steam.
```
go run main.go -url http://steamcommunity.com/market/listings/570/Taunt%3A%20Get%20Burned
```
*/
curl -T file.json -X POST "http://localhost/uri"