Skip to content

Instantly share code, notes, and snippets.

on idle {}
set SSID to current_SSID()
if SSID contains "HOME-SSID" then
if application "TogglDesktop" is running then
tell application "TogglDesktop" to quit
display notification "Connect " & SSID & " and stop toggl client" with title "toggle_toggl.scpt"
end if
else if SSID contains "OFFICE-SSID" then
if application "TogglDesktop" is not running then
tell application "TogglDesktop" to activate
@okada-takuya
okada-takuya / NewtonMethod.rb
Created November 8, 2014 02:07
情報学習理論の課題(ニュートン法)
#!/usr/bin/env ruby
# coding: utf-8
# ニュートン法によって連立方程式の解を探索するプログラム
THRES = 0.000001
count = 0
x1 = 3.0
x2 = 3.0
def fomula1(x1, x2)
@okada-takuya
okada-takuya / SteepestDescentMethod.rb
Created November 7, 2014 10:25
情報学習理論の課題(最急降下法)
#!/usr/bin/env ruby
# coding: utf-8
THRES = 0.000001
count = 0
x1 = 1.0
x2 = 1.0
def fomula1(x1, x2)
return x1 - Math.exp(x2)
@okada-takuya
okada-takuya / remote.rb
Last active August 29, 2015 14:06
Open remote repository pages
#!/usr/bin/env ruby
relative_path = `git rev-parse --show-cdup`.chomp
exit! unless $?.to_i == 0
config_path = Dir::pwd + relative_path + "/.git/config"
catch_repo = /url = git@github.com:(.+).git/
open(config_path) do |file|
file.each do |line|
@okada-takuya
okada-takuya / .zshrc
Last active August 29, 2015 14:04
My .zshrc setting
# .zshrc
# Copyright (C) 2014 Takuya Okada All Rights Reserved.
# source sub files
source ~/.zsh.d/aliases.zsh
source ~/.zsh.d/completion.zsh
source ~/.zsh.d/environment.zsh
source ~/.zsh.d/face.zsh
source ~/.zsh.d/path.zsh
source ~/.zsh.d/setopt.zsh