Skip to content

Instantly share code, notes, and snippets.

View yosmoc's full-sized avatar

Yoshihisa Mochihara yosmoc

  • IKEA IT AB
  • Sweden
View GitHub Profile
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := 1.0
for {
package main
import (
"fmt"
"io/ioutil"
"log"
)
func main() {
file, err := ioutil.ReadFile("for.go")
/* <system section="theme" selected="11696248318757940905"> */
@import url("http://hatenablog.com/theme/11696248318757940905.css");
/* </system> */
#blog-title {
border-top: none;
}
.entry {
border-bottom: none;
}
@yosmoc
yosmoc / gist:2155
Created July 24, 2008 14:11
rm_hatenagraph.rb
# -*- coding: utf-8 -*-
require 'mechanize'
require 'pit'
require 'uri'
pit = Pit.get('hatena', :require => {
'username' => 'username',
'password' => 'password'})
BASE = URI("http://graph.hatena.ne.jp/#{pit['username']}/")
#!/usr/bin/env ruby
require 'pit'
require 'mechanize'
require 'uri'
pit = Pit.get('github', :require => {
'username' => 'username',
'password' => 'password'})
BASE = URI('http://gist.github.com/')
- hosts: vm
sudo: yes
tasks:
- apt: update_cache=yes
- apt: name=zsh state=present
- apt: name=git state=present
- apt: name=emacs state=present
- apt: name=vim state=present
- apt: name=golang state=present
- apt: name=gist state=present
def default_value
p 'generate default_value'
'default value'
end
def some_method(param = nil)
param ||= default_value
p param
end
def default_value
p 'generate default_value'
'default value'
end
def some_method(param = nil)
param ||= default_value
p param
end
@yosmoc
yosmoc / file1.yml
Last active August 29, 2015 14:07
AnsibleでLinuxに最新版のpecoをインストールする ref: http://qiita.com/samurai20000@github/items/8d77f4b5a503ca58b64e
- name: Get latest peco version
shell: >
curl -sI https://github.com/peco/peco/releases/latest | awk -F'/' '/^Location:/{print $NF}'
register: peco_latest_version
@yosmoc
yosmoc / hosts
Created October 10, 2014 20:49
WIP: my ubuntu's playbook
[localhost]
127.0.0.1