Skip to content

Instantly share code, notes, and snippets.

View d1str0's full-sized avatar

Brady Sullivan d1str0

  • Imageware
  • Portland, Oregon
View GitHub Profile
@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/"
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.
# 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
# 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
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)
// 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));
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCvfmLS8OzlW/NdbSmM1VaefuhRZj4lu2kRcEoAdunZB5D96JqEkfgDI94T55JUPHn6ZI6+OJB8Q+Xikgpy/voD3VluD7nwKg9uq3aRleGVKMAujOORdpvQs0MqL9Lx8KIDztJ+UaoxPvWPQP6+6nUIOgOvP2uWniBKUhCZER2sZ6kq1Z5PFwB0kVbQglMfnogkejtc3uevrMiTkmRb25LvYEBwk/1MzRcX2Sl284yD+zRUUu9NVYvf/c/ioJN8fhM1PBTwHpcUs0DDoPV9PnDFze1x91zJhnSb73BtlsFXHy2PYNcbV1a5N5Tu7+NlgYMmKhlkqzK9vWGqM830YxuB brady@bsull.com
@d1str0
d1str0 / .vimrc
Created September 14, 2014 22:59
syntax on
noremap <C-j> :tabprevious<CR>
noremap <C-k> :tabnext<CR>
noremap <C-l> :tabedit
noremap <C-h> :tabclose<CR>
imap jj <ESC>
imap PPP <ESC>:set paste<CR>i
imap NP <ESC>:set nopaste<CR>i
location / {
index index.php;
rewrite ^/(.*)$ /index.php?__path__=/$1 last;
}