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 ( | |
"net/http" | |
"fmt" | |
"labix.org/v2/mgo" | |
"labix.org/v2/mgo/bson" | |
) | |
const messagesPath = "/messages/" |
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
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. |
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
# 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 |
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
# 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 |
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
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) |
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
// 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)); | |
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
<?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. |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCvfmLS8OzlW/NdbSmM1VaefuhRZj4lu2kRcEoAdunZB5D96JqEkfgDI94T55JUPHn6ZI6+OJB8Q+Xikgpy/voD3VluD7nwKg9uq3aRleGVKMAujOORdpvQs0MqL9Lx8KIDztJ+UaoxPvWPQP6+6nUIOgOvP2uWniBKUhCZER2sZ6kq1Z5PFwB0kVbQglMfnogkejtc3uevrMiTkmRb25LvYEBwk/1MzRcX2Sl284yD+zRUUu9NVYvf/c/ioJN8fhM1PBTwHpcUs0DDoPV9PnDFze1x91zJhnSb73BtlsFXHy2PYNcbV1a5N5Tu7+NlgYMmKhlkqzK9vWGqM830YxuB brady@bsull.com |
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
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 |
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
location / { | |
index index.php; | |
rewrite ^/(.*)$ /index.php?__path__=/$1 last; | |
} |
OlderNewer