This file contains 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
# 現在のユーザー名とホスト名をタイトルに | |
$global:currentuser = [System.Security.Principal.WindowsIdentity]::GetCurrent() | |
$user_and_host = ($currentuser.name -replace "(.*?)\\(.*?)$", "`$2@`$1") | |
$Host.UI.RawUI.WindowTitle = $user_and_host + " - Windows PowerShell" | |
# プロンプトのカスタマイズ | |
function prompt { | |
write-host "" | |
# ディレクトリの表示 (バックスラッシュをスラッシュに変換) |
This file contains 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 functions for PowerShell | |
# Copyright 2009-2019 Mark Embling (http://www.markembling.info/) | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# |
This file contains 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
# My preferred prompt for Powershell. | |
# Displays git branch and stats when inside a git repository. | |
# See http://gist.github.com/180853 for gitutils.ps1. | |
. (Resolve-Path ~/Documents/WindowsPowershell/gitutils.ps1) | |
function prompt { | |
$path = "" | |
$pathbits = ([string]$pwd).split("\", [System.StringSplitOptions]::RemoveEmptyEntries) | |
if($pathbits.length -eq 1) { |
This file contains 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
# | |
# Show branch name in Zsh's right prompt | |
# | |
autoload -Uz VCS_INFO_get_data_git; VCS_INFO_get_data_git 2> /dev/null | |
setopt prompt_subst | |
function rprompt-git-current-branch { | |
local name st color gitdir action |
This file contains 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
// Example: | |
JavaScript.load("/javascripts/something.js"); | |
// With callback (that’s the good thing): | |
JavaScript.load("http://www.someawesomedomain.com/api.js", function() { | |
API.use(); // or whatever api.js provides ... | |
}); |
This file contains 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 | |
# | |
#################################### | |
# iTunes Command Line Control v1.0 | |
# written by David Schlosnagle | |
# created 2001.11.08 | |
# edit 2010.06.01 rahul kumar | |
#################################### | |
showHelp () { |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argv, char *argc[]) | |
{ | |
if (argv!=2) | |
{ | |
printf("Usage: %s \"threadtime_format_logcat_file\"\n",__FILE__); | |
exit(-1); | |
} |
This file contains 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
# changes the filename used for reading and writing with the paste buffer. | |
bufferfile 'screen/screen-exchange' | |
# copy the screen pastbuffer to the Cygwin pastebord | |
bindkey -m ' ' eval 'stuff \040' 'writebuf' 'exec sh -c "/usr/bin/putclip < screen/screen-exchange"' | |
bindkey -m Y eval 'stuff Y' 'writebuf' 'exec sh -c "/usr/bin/putclip < screen/screen-exchange"' | |
bindkey -m W eval 'stuff W' 'writebuf' 'exec sh -c "/usr/bin/putclip < screen/screen-exchange"' |
This file contains 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/sh | |
# | |
# Create Google Chrome launcher (for Mac) | |
# | |
CHROME_APP="/Applications/Google Chrome.app" | |
CHROME_PROFILE_DIR="$HOME/Library/Application Support/Google/Chrome" | |
echo "Enter profile name: \c" |
This file contains 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
-- nyaosのgit向けluaコマンド | |
-- print('loading... "_nya_git.lua"') | |
-- $git submodule rm | |
-- サブモジュールの削除 | |
-- http://labs.timedia.co.jp/2011/03/git-removing-a-submodule.html | |
nyaos.command['git submodule rm'] = function(name) | |
local modulepath = nyaos.eval('git config --file .gitmodules --get submodule.' .. name .. '.path'); | |
nyaos.exec('git rm --cached ' .. modulepath); | |
nyaos.exec('git config --file .gitmodules --remove-section submodule.' .. name); | |
nyaos.exec('git commit -m "Remove submodule '..name..'"') |
OlderNewer