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
# mongodb用 | |
gem install mongo bson_ext | |
# twitter用 | |
gem install tweetstream |
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
require 'yaml' | |
# これをやらないと警告が沢山出る | |
# http://stackoverflow.com/questions/8783400/warning-already-initialized-constant-after-installing-tlsmail-gem | |
require 'net/smtp' | |
Net.instance_eval {remove_const :SMTPSession} if defined?(Net::SMTPSession) | |
require 'net/pop' | |
Net::POP.instance_eval {remove_const :Revision} if defined?(Net::POP::Revision) | |
Net.instance_eval {remove_const :POP} if defined?(Net::POP) |
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 | |
if [ $# -ne 1 ]; then | |
echo "plese set folder" 1>&2 | |
exit 1 | |
fi | |
dir=$1 | |
main=${dir%/} | |
today=`date "+%d.txt"` |
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
module.exports = (robot) -> | |
robot.router.post "/hubot/send_message", (req, res) -> | |
if not req.body | |
res.end "" | |
return | |
room_name = req.body.room | |
message = req.body.message |
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
package main | |
import ( | |
"fmt" | |
"github.com/ChimeraCoder/anaconda" | |
"net/url" | |
) | |
func showTimeLine(api *anaconda.TwitterApi, v url.Values) { | |
tweets, err := api.GetUserTimeline(v) |
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
package main | |
import ( | |
"fmt" | |
"github.com/ChimeraCoder/anaconda" | |
"gopkg.in/mgo.v2" | |
"gopkg.in/mgo.v2/bson" | |
"net/url" | |
) |
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
package main | |
import ( | |
"fmt" | |
"github.com/robfig/cron" | |
"time" | |
) | |
func main() { | |
c := cron.New() |
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
type Name = String | |
colorName :: NamedColor -> Name | |
colorName c = case c of | |
Red -> "赤" | |
Green -> "緑" | |
Blue -> "青" | |
main = | |
print 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
package main | |
import "fmt" | |
type If interface{ // PrintDataメソッドを持つインターフェースを定義 | |
PrintData() | |
} | |
type MyBase struct { | |
Count int |
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
package main | |
import "fmt" | |
type Point struct { | |
x float64 | |
y float64 | |
} | |
func LeastSquaresMethod(points *[]Point) (a float64, b float64){ |
OlderNewer