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 | |
// set up options array | |
$options = array( | |
"location" => 'http://192.168.25.28/soap.php', | |
"uri" => 'http://192.168.25.28', | |
"trace" => 2 | |
); | |
// connect to soap server |
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
<? | |
//just say i have an object without __set() defined... | |
//will this work? | |
$foo->squiggle = "zebra"; | |
//now just say the set function is defined like this: | |
function __set($name, $value) { | |
var_dump($name, $value); |
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 | |
//Define a simple class | |
class Foo { | |
//run this whenever a variable of this class is set | |
function __set($name, $value) { | |
//store the value we're setting in a completely arbitrary place | |
$this->morp = $value; | |
} |
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
<? | |
//tabular.php line 2856 | |
case "editsquidconstraint": | |
$output->title = "Edit Constraint"; | |
$output->title_desc = ""; | |
$output->data .= Tabular_view::view_editconstraint($blah); | |
break; | |
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
#!/bin/bash | |
#As reconcile.php runs, it adds entries to invoice, receipt, etc. tables. | |
#The timestamp fields in these tables reference the dw_timestamp table | |
#So, we need to add every conceivable date to dw_timestamp | |
#back to 1900 should be enough ^_^ | |
#set a variable to use as an iteration counter | |
export i=0; |
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
<? | |
function make_salt($salt_size=32) { | |
//list of possible characters from which to cerate the salt | |
$sea = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; | |
//how many possible characters are there | |
$sea_size = strlen($sea); | |
$salt = ""; |
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
<? | |
function checkPhone($int_dial_code, $area_code, $local_number) { | |
//try to check and reformat australian numbers | |
if ($int_dial_code == "61") { | |
//combine the area code and local number | |
$full_phone = $area_code.$local_number; | |
//strip spaces and hyphens | |
$full_phone = str_replace(array(" ", "-"), "", $full_phone); | |
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
with dates as ( | |
select sysdate-240 as sometime from dual | |
union select sysdate-180 as sometime from dual | |
union select sysdate-120 as sometime from dual | |
union select sysdate-60 as sometime from dual | |
union select sysdate as sometime from dual | |
union select sysdate+60 as sometime from dual | |
union select sysdate+120 as sometime from dual | |
union select sysdate+180 as sometime from dual | |
union select sysdate+240 as sometime from dual |
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 | |
if ($_FILES['userfile']['size'] > 5 * 1024 * 1024) { | |
$error = 'File is too large.'; | |
@unlink($_FILES['userfile']['tmp_name']) || $error .= $php_errormsg; | |
} |
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
#!/usr/bin/env ruby | |
require 'base64' | |
require 'digest' | |
# get 16 random hex bytes | |
# | |
def new_salt | |
16.times.inject('') {|t| t << rand(16).to_s(16)} | |
end |
OlderNewer