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 ( | |
"encoding/json" | |
"fmt" | |
) | |
func main() { | |
fmt.Println("Hello, playground") |
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 ( | |
"encoding/json" | |
"fmt" | |
) | |
type mydata struct { | |
First string `json:first` | |
Second float32 `json:second` |
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 ( | |
"encoding/json" | |
"fmt" | |
) | |
func main() { | |
b := []byte(`{ | |
"k1" : "v1", |
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 ( | |
"encoding/json" | |
"fmt" | |
) | |
type Envelope struct { | |
Token string `json:token` | |
Project string `json:project` |
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" | |
"log" | |
"net/http" | |
"net/url" | |
"strings" | |
"github.com/PuerkitoBio/goquery" |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'xmpp4r' | |
require 'xmpp4r/muc/helper/simplemucclient' | |
# Most of this is borrowed from https://gist.github.com/941931 | |
# Added support for multiple rooms and external handling of messages. | |
# We want the MUC functionality to just handle shit for us. Unfortunately we | |
# have to override/repeat the join method in order to add the directive that |
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
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Update 7 Oct 2010: | |
# - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
# the WebSocket protocol implementation in the cramp gem does not work | |
# well with Chrome's (newer) WebSocket implementation. | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
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
#!/usr/bin/ruby | |
# README | |
# gem install aws-sdk | |
# add this to bashrc | |
# export HT_DEV_AWS_ACCESS_KEY_ID=???? | |
# export HT_DEV_AWS_SECRET_ACCESS_KEY=???? | |
# put your pem file in ~/.ssh and chmod 0400 | |
# for more info see; https://rubygems.org/gems/aws-sdk |
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
# I made some small changes to this: http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-filesystem-from-the-command-line.html | |
# to install: curl https://raw.github.com/gist/6393682 >> ~/.bashrc; mkdir ~/.marks | |
export MARKPATH=$HOME/.marks | |
function jump { | |
cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1" | |
} | |
function mark { | |
mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$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
#!/usr/bin/env ruby | |
require 'socket' | |
@mysocket = TCPSocket.new('127.0.0.1', 9761) | |
while true | |
ready = IO.select([@mysocket]) | |
readable = ready[0] |
NewerOlder