Skip to content

Instantly share code, notes, and snippets.

View treeder's full-sized avatar
🥌

Travis Reeder treeder

🥌
View GitHub Profile
@treeder
treeder / Gemfile
Last active August 29, 2015 14:17
Slack hellobot Gemfile
source "http://rubygems.org"
gem 'slack_webhooks'
gem 'iron_worker'
@treeder
treeder / bundle install
Created March 21, 2015 21:13
Slack hellobot bundle install
docker run --rm -v "$(pwd)":/worker -w /worker iron/images:ruby-2.1 sh -c 'bundle install --standalone'
@treeder
treeder / slack.payload
Last active August 29, 2015 14:17
Slack hellobot example payload
token=somerandomtoken&team_id=someteamid&team_domain=somename&channel_id=somechannelid&channel_name=random&user_id=someid&user_name=travis&command=%2Fhello&text=penguins
@treeder
treeder / run.sh
Last active August 29, 2015 14:17
Slack hellobot docker run
docker run --rm -v "$(pwd)":/worker -w /worker iron/images:ruby-2.1 sh -c 'ruby hellobot.rb -payload slack.payload -config config.json'
@treeder
treeder / upload.sh
Last active August 29, 2015 14:17
Slack hellobot zip and upload
zip -r hellobot.zip .
iron worker upload --stack ruby-2.1 --config-file config.json hellobot.zip ruby hellobot.rb
@treeder
treeder / config.json
Created March 22, 2015 01:25
Slack hellobot config
{
"webhook_url": "https://hooks.slack.com/services/abc/123/xyz"
}
@treeder
treeder / config.json
Last active August 29, 2015 14:17
IronMQ Single Tenant Config
{
"api": {
"http_port": 8080
},
"aes_key": "C0AECA893AEAE6CBFDF19F3B3EE044D4",
"data": {
"dir": "../data",
"cache_size": 128
},
"logging": {
@treeder
treeder / list_channels.rb
Created July 20, 2015 17:33
Simple script to list all your slack channels. Good way to get the id.
require 'rest-client'
r = RestClient.post "https://yourskinbox.slack.com/api/channels.list",
{
:token => 'API_TOKEN'
}
r = JSON.parse(r)
r['channels'].each do |c|
puts "#{c['name']} - id: #{c['id']}"
end
@treeder
treeder / app.go
Created July 31, 2015 00:16
Simple web server using Gorilla.
package main
import (
"fmt"
"log"
"net/http"
"github.com/treeder/easy-go-in-docker/Godeps/_workspace/src/github.com/gorilla/mux"
)
func main() {
docker run --rm -it -v $PWD:/go/src/x/y/z -w /go/src/x/y/z -e "GOPATH=/go/src/x/y/z/vendor:/go" golang go get