Skip to content

Instantly share code, notes, and snippets.

View williamsbdev's full-sized avatar

Brandon Williams williamsbdev

View GitHub Profile
# this command will return places where the application shells out or dynamically executes code:
egrep -r --include "*.py" -e "(exec|eval)\(|subprocess|popen" .
# DJANGO: find places where HTML encoding is turned off via the "safe" attribute:
grep -r --include "*.py" --include "*.html" -e "|safe" .
# DJANGO: find places where unsafe SQL queries are executed:
egrep -r --include "*.py" -e "\.(raw|execute)\(" .
# Non zero values indicate that some sort of CSRF protection is probably enabled.
# this command will return places where the application shells out or dynamically executes code:
egrep -r --include "*.rb" -e "(exec|eval|system)(\(| \"| \')|\`.*\`|%x(\(|\[|\{|\<)" .
# RAILS: find places where unsafe SQL queries are executed:
egrep -r --include "*.rb" -e "\.(find_by_sql|select_all|exec_query|execute)(\(| \"| \')" .
# RAILS: find places where HTML encoding is turned off via the "safe" attribute:
egrep -r --include "*.erb" -e ".html_safe|raw(\(| \"| \')" .
# returns hardcoded credentials
import Ember from 'ember';
var injection = function(key, name) {
return Ember.computed(function(propertyName) {
var objectName = name || propertyName;
return this.container.lookup(key + ':' + objectName);
});
};
export default injection;
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
Put the following in the .config/flake8 file in your root directory.
[flake8]
max-line-length=120
@williamsbdev
williamsbdev / shifts.handlebars
Created December 29, 2013 20:20
ember-promises blog post handlebars example
{{shift.name}} - {{shift.number_of_people}}
@williamsbdev
williamsbdev / new_class.coffee
Created January 26, 2013 01:33
Including jQuery in your coffeeScript class.
NewClass = (($) ->
NewClass = (params) ->
@params = params
NewClass::someFunction = ->
console.log "do something"
NewClass
)(jQuery)