Skip to content

Instantly share code, notes, and snippets.

View d1str0's full-sized avatar

Brady Sullivan d1str0

  • TECH5 USA
  • Portland, Oregon
View GitHub Profile
// Load our curl helper class we got from StackOverflow
$this->load->helper('Curl');
$curl = new Curl();
$html = $curl->get("http://movies.yahoo.com/showtimes/$zipcode");
// Now that we have the HTML for the page, let's parse it!
$DOM = new DOMDocument;
$DOM->loadHTML(htmlentities($html));
import socket
import random
import itertools
def play():
for i in range(0,10):
#moves = list(itertools.product([0,1,2], repeat=3))
#random.shuffle(moves)
# Local, Mac OS X side
bind-key a send-prefix
set-window-option -g window-status-current-bg red
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
# Remote, Ubuntu side (has xclip installed)
bind-key a send-prefix
set-window-option -g window-status-current-bg red
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
client := &http.Client{}
posturl := server + "deliver_message" // Attempt to hit the deliver_message api call,
values := url.Values{"value1": {someValue}, "value2": {"some constant string"}} // with this info.
data, err := json.Marshal(values) // Turn values into json.
// check err.
req, err := http.NewRequest("POST", posturl, strings.NewReader(string(data))) // Turn json []bytes into a string then ioReader.
// check err.
req.Header.Add("Content-Type", "application/json") // Set the apropriate header.
resp, err := client.Do(req)
// check err.
@d1str0
d1str0 / gist:6407010
Created September 1, 2013 20:11
Not tested, just a prototype.
package main
import (
"net/http"
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
)
const messagesPath = "/messages/"