Skip to content

Instantly share code, notes, and snippets.

View bkilshaw's full-sized avatar

Brad Kilshaw bkilshaw

View GitHub Profile
<?php
define("ALTERNATE_LANGUAGE_DIRECTORY", "sp");
$referer = $_SERVER['HTTP_REFERER'];
$redirect = create_redirect($referer);
header("Location: $redirect");
function create_redirect($referer) {
<?php // BRAD
$numbers = array("1", "2", "3", "4", "5");
function array_print($values) {
$array = array_reverse($values);
print_values($array);
}
function print_values($array) {
echo array_pop($array);
<?php
function hash_password($password, $salt = false) {
if(!$salt) {
$gen_salt = generate_random_string();
$hashed['salt'] = '$6$rounds=150000$' . $gen_salt . '$';
} else {
$hashed['salt'] = '$6$rounds=150000$' . $salt . '$';
}
$("#brandmenu div").click(function(){
var newBackground = $(this).attr("background");
var backgroundString = "transparenet url (img/" + newBackground + ") top left no-repeat";
$("body").css("background", backgroundString);
if(newBackground == "intel_2a_1.png") {
$("#breakoutSession").show();
} else {
$("#breakoutSession").hide();
| 1684 | 275.96 | -13.04 |
| 1685 | 39.22 | -0.54 |
| 1686 | pitch | yaw |
| 1687 | pitch | yaw |
| 1691 | pitch | yaw |
| 1689 | pitch | yaw |
| 1690 | pitch | yaw |
| 1692 | pitch | yaw |
| 1694 | pitch | yaw |
| 1695 | pitch | yaw |
<?php
class SQLQuery {
public $query = "";
private $allowed_query_types = array(
'insert'
, 'delete'
, 'update'
, 'select'
);
@bkilshaw
bkilshaw / SQLQuery.php
Created May 6, 2011 05:59
PHP SQLQuery Class
<?php
// Run a query and return results
class SQLQuery {
public $query = "";
private $allowed_query_types = array(
'INSERT'
, 'DELETE'
, 'UPDATE'
server {
listen 80;
server_name domain.com www.domain.com;
root /var/www/domain.com/public;
index index.html index.php;
try_files $uri /index.php?id=$uri
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
mysql> describe urls;
+---------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| url | text | NO | | NULL | |
| userKey | varchar(255) | YES | | NULL | |
| userIp | varchar(255) | YES | | NULL | |
+---------+--------------+------+-----+---------+----------------+
4 rows in set (0.00 sec)
deb http://archive.ubuntu.com/ubuntu oneiric universe
deb-src http://archive.ubuntu.com/ubuntu oneiric universe
deb http://archive.ubuntu.com/ubuntu oneiric-updates universe
deb-src http://archive.ubuntu.com/ubuntu oneiric-updates universe
deb http://archive.ubuntu.com/ubuntu oneiric-security main
deb-src http://archive.ubuntu.com/ubuntu oneiric-security main