Skip to content

Instantly share code, notes, and snippets.

View saghaulor's full-sized avatar

Stephen Aghaulor saghaulor

View GitHub Profile
@saghaulor
saghaulor / csrf.rb
Created April 19, 2019 17:59
A sample controller and route demonstrating CSRF vulnerabilities
class AcountsController < ApplicationController
before_action :set_current_user
def transfer
from_account = Account.find(owner_id: current_user.id)
to_account = Account.find(id: params(:to_id)
AccountTransferService.call(from: from_account, to: to_account, amount: params(:amount))
end
end

Keybase proof

I hereby claim:

  • I am saghaulor on github.
  • I am saghaulor (https://keybase.io/saghaulor) on keybase.
  • I have a public key ASAPe25aGH6bLpwgxLwKQafHpGw6PsWlIYsWNLKIPvTokgo

To claim this, I am signing this object:

2015-05-04 15:05:30 -0700
./autogen.sh
Checking whether you have the necessary tools...
(Read INSTALL.REPO for more details on building Emacs)
Checking for autoconf (need at least version 2.65)...
ok
Checking for automake (need at least version 1.11)...
2015-04-18 18:19:43 -0700
./autogen.sh
Checking whether you have the necessary tools...
(Read INSTALL.REPO for more details on building Emacs)
Checking for autoconf (need at least version 2.65)...
ok
Checking for automake (need at least version 1.11)...
#!/bin/sh
.git/hooks/ctags >/dev/null 2>&1 &
#!/bin/sh
set -e
PATH="/usr/local/bin:$PATH"
ctags --tag-relative=yes --extra=+fq --append=no --languages-sql --exclude=.git --exclude=tmp --exclude=log --exclude=public/javascripts/translations --exclude=.bundle/bin -eRf .git/tags
#!/bin/sh
# borrowed heavily from http://stackoverflow.com/a/17270862
jiraNumber=$(git branch | grep '*' | egrep -io '[C][[:alpha:]][-[:digit:]]+')
firstLine=$(head -n1 $1)
if [ -z "$firstLine" ] ;then # Check that this is not an amend by checking that the first line is empty
sed -i "" "1s/^/$jiraNumber /" $1 # Insert branch name at the start of the commit message file
fi

ruby-1.9.3-p545 cumulative performance patch for rbenv

(I guarantee nothing. No warranty I am not responsible blah blah blah. Seems to work great for me so far. Thanks to Tyler Bird who I forked this from.)

This installs a patched ruby 1.9.3-p545 with the railsexpress patchsets: https://github.com/skaes/rvm-patchsets

Requirements

@saghaulor
saghaulor / README.md
Created November 4, 2012 23:21 — forked from ngauthier/README.md
Rdio "native" in linux

I like Rdio and linux. Rdio works great in a browser except for one thing: keyboard shortcuts!!!

When coding, I like to be able to play/pause my music quickly, meaning I don't want to switch windows. I figured out a way to do this:

Google Chrome --app

First, I made a file in my ~/bin called rdio that runs:

google-chrome --app=http://rdio.com