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
### append to .bashrc | |
alias pbcopy="iconv -f UTF-8 -t CP932 | /c/Windows/System32/clip.exe" |
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() { | |
let c = window.getSelection().toString(); | |
if (c == ""){ | |
c = window.prompt("Input character.", ""); | |
} | |
let a = []; | |
for (let i of c) { | |
a.push(i.charCodeAt()); | |
} | |
alert(a); |
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
javascript:(function(){let url=location.href;let title=document.title;url=encodeURIComponent(url);title=encodeURIComponent(title);window.open('https://twitter.com/intent/tweet?url='+url+'&text='+title,'_blank');})(); |
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
#!/bin/bash | |
while read line; do | |
if [[ $line =~ ^alias ]]; then | |
echo -n aliases\[\""$(echo "$line" | cut -d'=' -f 1 | sed -e "s/alias //g" )"\"\] = | |
echo " $(echo "$line" | cut -d'=' -f 2-)" | |
fi | |
done < ~/.bashrc |
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
#!/bin/bash | |
current_branch="$(git branch | grep \* | sed -e "s/\*\ //")" | |
echo "Push to $current_branch" | |
if [ "$current_branch" = "master" ]; then | |
read -rp "Are you sure?:" confirm | |
if [ "$confirm" = "y" ]; then | |
git push origin master | |
else | |
echo "" | |
fi |
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
cat "$HOME"/.bash_history | sort | uniq -c | sort -rn | head |
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
#!/bin/bash | |
## $1=format | |
set -Cue | |
generate_file=`basename "$(pwd)" | sed -e "s/\$/.m3u/g"` | |
echo '#EXTM3U' >> "$generate_file" | |
if [ -z "$1" ]; then | |
format=wav | |
else | |
format="$1" |
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
#!/bin/bash | |
# This script can use in macOS or Linux | |
# Change [proxy] and [port] | |
# Execute $ source proxy_switch.bash | |
proxy="" | |
port="" | |
if [ -z $http_proxy ]; then | |
echo "Enable" | |
export http_proxy="http://${proxy}:${port}/" | |
else |
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
#!/bin/bash | |
### unarchve multiple files with unar | |
set -Cue | |
if test $# -gt 0; then | |
for i in "$@"; do | |
unar $i | |
done | |
fi |
NewerOlder