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
// ==UserScript== | |
// @name Google Search Helper | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description My helper script for Google search | |
// @author Yumenosuke Koukata | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js | |
// @match *://www.google.com/* | |
// @match *://www.google.co.jp/* | |
// @grant none |
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
using System; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public static class ComponentExtensions { | |
public static T GetOrAddComponent<T>(this Component component) where T : Component => component.GetComponent<T>() ?? component.gameObject.AddComponent<T>(); | |
} |
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 JAVA_HOME=`/usr/libexec/java_home -v $(jenv global 2>/dev/null) 2>/dev/null` |
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 zsh | |
# powerlevel9k theme settings (https://github.com/bhilburn/powerlevel9k) | |
# font mode | |
POWERLEVEL9K_MODE='nerdfont-complete' | |
# light theme? | |
# POWERLEVEL9K_COLOR_SCHEME='light' | |
# datetime format |
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
require 'mechanize' | |
require 'json' | |
# your my softbank login id and password | |
phone = "***********" | |
password = "********" | |
agent = Mechanize.new | |
agent.user_agent_alias = 'iPhone' | |
agent.follow_meta_refresh = true |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace Hanoi { | |
class HanoiTower { | |
static void Main(string[] args) { | |
int height; | |
if (args.Length == 0 || !int.TryParse(args[0], out height)) height = 3; | |
var count = 0; |
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
() { # zcompile if needed | |
local src | |
for src in $@; do | |
([[ ! -e $src.zwc ]] || [[ $src:A -nt $src.zwc ]]) && zcompile $src | |
done | |
} ~/.zshenv ~/.zshrc ~/.zprofile ~/.zlogin ~/.zlogout |
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
zle-pbcopy-buffer(){ echo -n ${(z)BUFFER} | pbcopy } | |
zle -N zle-pbcopy-buffer |
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 zsh | |
(){ | |
local plistfile="$HOME/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist" | |
local i=0 | |
while [[ $i != "false" ]]; do | |
[[ `/usr/libexec/PlistBuddy -c "Print :LSHandlers:$i" $plistfile 2>/dev/null` ]] || break | |
ext=`/usr/libexec/PlistBuddy -c "Print :LSHandlers:$i:LSHandlerContentTag" $plistfile 2>/dev/null` |
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
# cd to parent directory of the file (even if it is symbolic link) | |
function pd() { | |
local dir=`realpath ${1:-.}` | |
cd $dir(:A:h) | |
} | |
# alias -g ...=../../, ....=../../../, .....=../../../../, ...... | |
`ruby -e "(2..20).each{|i| puts 'alias -g .'+'.'*i+'='+'../'*i}"` | |
true |