This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ls -l | grep -v 'xxxx.file' | xargs rm -rf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
content = [] | |
$('.css-jtwxy5-logs-rows').html().replace(/post_id[^\:]*:"(\w+)"/g, function($0, $1) { | |
content.push($1); | |
return $0; | |
}) | |
// 删除某个元素 | |
Array.prototype.remove = function(val) { | |
var index = this.indexOf(val); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git remote set-url --add --push origin <repo-url-here> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export GOENV_ROOT="$HOME/.goenv" | |
export PATH="$GOENV_ROOT/bin:$PATH" | |
eval "$(goenv init -)" | |
export PATH="$GOROOT/bin:$PATH" | |
export PATH="$GOPATH/bin:$PATH" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate SHA256 hash | |
require 'digest' | |
Digest::SHA256.hexdigest "your_string" | |
# Generate MD5 | |
require 'digest/md5' | |
Digest::MD5.hexdigest "your_string" | |
# Generate UUID | |
SecureRandom.uuid.split('-').join |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo '#!/bin/bash | |
command="docker ps" | |
for arg in $@; do | |
command="$command | grep $arg" | |
done | |
command="$command | grep -v haproxy | head -1" | |
if [[ `eval $command` =~ "piledriver" ]]; then | |
entrance="/bin/sh" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "pathname" | |
unless ARGV[0] | |
puts 'Usage: newpost "the post title"' | |
exit(-1) | |
end | |
date_prefix = Time.now.strftime("%Y-%m-%d") | |
postname = ARGV[0].strip.downcase.gsub(/ /, '-') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function vpn-connect { | |
/usr/bin/env osascript <<-EOF | |
tell application "System Events" | |
tell current location of network preferences | |
set VPN to service "公司l2tp" -- your VPN name here | |
if exists VPN then connect VPN | |
repeat while (current configuration of VPN is not connected) | |
delay 1 | |
end repeat | |
end tell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# place this file in ~/.config/terminator/config | |
[global_config] | |
title_transmit_bg_color = "#d30102" | |
focus = system | |
[keybindings] | |
reset_clear = <Ctrl>R | |
new_tab = <Ctrl>T | |
split_horiz = <Ctrl><Shift>E | |
split_vert = <Ctrl>E | |
close_term = <Ctrl><Shift>W |