my hammerspoon confing
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
| def wepkey2ascii(key) | |
| key.to_s.scan(/../).map { |s| s.hex.chr }.join | |
| end | |
| #=> "01fc91ab8b648" |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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/sh | |
| exec ruby -S -x "$0" "$@" | |
| #! ruby | |
| def main | |
| if $*.length == 0 | |
| ymd = [Time.now.year, Time.now.month].map &:to_i | |
| mon = MonthView.new ymd[0], ymd[1] | |
| print sprintf("%-6d",Time.now.year) | |
| puts mon.view |
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
| # coding: utf-8 | |
| def func(n, m, N): | |
| def state(cnt, acc): | |
| if N == cnt: | |
| return acc | |
| else: | |
| return state(cnt + 1, (1 - 1/n - 1/m) * acc + 1/m) | |
| return state(0, 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 | |
| sudo apt-get update -y | |
| # Install the rbenv and Ruby dependencies with apt-get: | |
| sudo apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev nodejs |
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
| class InvalidSemanticVersionError < StandardError; end | |
| class SemanticVersion | |
| def initialize(sem_str) | |
| raise InvalidSemanticVersionError unless _valid_schema? sem_str | |
| @version_ary = sem_str.split('.').freeze | |
| end | |
| def version_ary |
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 'date' | |
| require 'pathname' | |
| ARTICLE_PATH = 'source/contents/articles/' | |
| STUB_START_DATE = '2018-01-01' | |
| namespace :stub do | |
| @article_path = Pathname.pwd + Pathname.new(ARTICLE_PATH) |
subscribe non default features
/github subscribe {user}/{repo} reviews comments branches commits:all