Skip to content

Instantly share code, notes, and snippets.

View GenbuHase's full-sized avatar
📚
Restart

長谷 玄武 (Genbu Hase) GenbuHase

📚
Restart
View GitHub Profile
@naokazuterada
naokazuterada / reset_rebase.sh
Last active May 15, 2024 05:40
git rebaseを間違えた時に元に戻す
git reflog
# これで、以下の様なのが参照できる
2be6f11 HEAD@{0}: xxxxxxxxxxxx
18389ad HEAD@{1}: xxxxxxxxxxxxx
0c485c8 HEAD@{2}: xxxxxxxxxxxxxx
b751438 HEAD@{3}: xxxxxxxxxxxxxxx # ここに戻したいので一つ前の数字を指定↓
hc8a0s8 HEAD@{4}: xxxxxx
# 「q」で戻って・・・
git reset --hard 'HEAD@{4}'
# のように数字を指定すると元に戻る!
range2array = function(num1,num2){
if (num1 > num2){
temp = num1;
num1 = num2;
num2 = temp;
}
var ary = [];
for(var i = num1; i <= num2; i++){
ary.push(i);
@Daniel15
Daniel15 / 1_README.md
Last active March 22, 2025 04:24
Complete Google Drive File Picker example

Google Drive File Picker Example

This is an example of how to use the Google Drive file picker and Google Drive API to retrieve files from Google Drive using pure JavaScript. At the time of writing (14th July 2013), Google have good examples for using these two APIs separately, but no documentation on using them together.

Note that this is just sample code, designed to be concise to demonstrate the API. In a production environment, you should include more error handling.

See a demo at http://stuff.dan.cx/js/filepicker/google/

@kunst1080
kunst1080 / MouseController.vbs
Last active October 5, 2024 14:24
VBScriptでマウスポインタを動かしたりクリックしたり座標を取得したりするサンプル
Set Excel = WScript.CreateObject("Excel.Application")
'キーコード
Const VK_SHIFT = &H10
'マウス定数
Const MOUSEEVENTF_ABSOLUTE = &H8000
Const MOUSE_MOVE = &H1
Const MOUSEEVENTF_LEFTDOWN = &H2
COnst MOUSEEVENTF_LEFTUP = &H4
@rosylilly
rosylilly / gist:3401612
Created August 20, 2012 06:40
先輩と覚える HTTP ステータスコード

先輩に学ぶ HTTP Status Code

超雑にまとめました。修正してください。

登場人物

  • アプリケーション先輩: いつも忙しい。横に広がるのが得意(デブじゃない)。
  • 後輩: 頼んでばっかしで役に立たない。
  • サーバー先輩: アプリケーション先輩と仲がいい。Unix Socket でつながるくらい仲良し。
  • プロクシ先輩: アプリケーション先輩とかサーバー先輩と後輩の間を取り持って代わりに伝えたりしてくれる。たまに勝手にレスポンスを書き換える。
@shokai
shokai / gsay
Created June 8, 2012 01:52
Mac/Linuxでsay(喋らせる)系コマンド
#!/bin/sh
TMP=/tmp/gsay.mp3
curl --silent --user-agent "Safari/1.0" "http://translate.google.com/translate_tts?q=$1&tl=ja" > $TMP && afplay $TMP && rm -f $TMP