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
package main
import (
"fmt"
"golang.org/x/crypto/bcrypt"
)
func encryptPassword(password string) (string, error) {
bytePass := []byte(password)
hashedPassword, err := bcrypt.GenerateFromPassword(bytePass, bcrypt.DefaultCost)
@d1str0
d1str0 / a.rb
Created February 4, 2016 01:24
http://stackoverflow.com/questions/2438400/reset-push-notification-settings-for-app
syntax on
execute pathogen#infect()
let mapleader = ","
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
describe '#update' do
it 'should update a card when given valid data' do
post :create, card: {:cardtext => "hello world", :cardtype => 'text'} , :format => :json
@results = JSON.parse(response.body)
@id = TextContent.find(@results['content_id']).id
put :update, :id => @id, :card => { :text => 'dlrow olleh' }, :format => :json
@results = JSON.parse(response.body)
expect(TextContent.find(@results['content_id']).text).to eq "dlrow olleh"
end
DangerZone ➜ GoHello git:(master) git checkout -b asdf
Switched to a new branch 'asdf'
DangerZone ➜ GoHello git:(asdf) git branch -D asdf
error: Cannot delete the branch 'asdf' which you are currently on.
DangerZone ➜ GoHello git:(asdf) git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
DangerZone ➜ GoHello git:(master) git branch -D asdf
Deleted branch asdf (was d21ca95).
DangerZone ➜ GoHello git:(master)
server {
server_name phab.pwnlandia.com;
root /git/phabricator/webroot;
location / {
index index.php;
rewrite ^/(.*)$ /index.php?__path__=/$1 last;
}
location = /favicon.ico {
location / {
index index.php;
rewrite ^/(.*)$ /index.php?__path__=/$1 last;
}
@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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCvfmLS8OzlW/NdbSmM1VaefuhRZj4lu2kRcEoAdunZB5D96JqEkfgDI94T55JUPHn6ZI6+OJB8Q+Xikgpy/voD3VluD7nwKg9uq3aRleGVKMAujOORdpvQs0MqL9Lx8KIDztJ+UaoxPvWPQP6+6nUIOgOvP2uWniBKUhCZER2sZ6kq1Z5PFwB0kVbQglMfnogkejtc3uevrMiTkmRb25LvYEBwk/1MzRcX2Sl284yD+zRUUu9NVYvf/c/ioJN8fhM1PBTwHpcUs0DDoPV9PnDFze1x91zJhnSb73BtlsFXHy2PYNcbV1a5N5Tu7+NlgYMmKhlkqzK9vWGqM830YxuB brady@bsull.com
<?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.