Skip to content

Instantly share code, notes, and snippets.

View joshtronic's full-sized avatar
🪦
Most forks are graves, not gardens

Josh Sherman joshtronic

🪦
Most forks are graves, not gardens
View GitHub Profile
// {{{ Flush User Cache
public function flushCache($user_id)
{
$this->cache->delete('USER-' . $user_id);
}
// }}}
<?php
if ($module_data['buyers'])
{
?>
<h4>Customer Map</h4>
<div id="map_canvas" style="width:310px;height:310px"></div><br />
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=true&amp;key=<?=$config->google['maps'];?>" type="text/javascript"></script>
<?=Utility::dynamicJavascript('gmaps/markermanager');?>
<?=Utility::dynamicJavascript('clusterer/Clusterer2');?>
<script type="text/javascript">
bcp "SELECT * FROM BargainBee_Production.INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'AdminUser' " queryout "c:\temp\DB\Header-AdminUser.txt" -t@**@ -c -T;
bcp "SELECT * FROM BargainBee_Production.INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'BillingInfo' " queryout "c:\temp\DB\Header-BillingInfo.txt" -t@**@ -c -T;
bcp "SELECT * FROM BargainBee_Production.INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'City' " queryout "c:\temp\DB\Header-City.txt" -t@**@ -c -T;
bcp "SELECT * FROM BargainBee_Production.INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Deal' " queryout "c:\temp\DB\Header-Deal.txt" -t@**@ -c -T;
bcp "SELECT * FROM BargainBee_Production.INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'DealLocations' " queryout "c:\temp\DB\Header-DealLocations.txt" -t@**@ -c -T;
bcp "SELECT * FROM BargainBee_Production.INFORMATION_S
@joshtronic
joshtronic / gist:2417850
Created April 19, 2012 02:01
shit-cock.php
<?php
if (false);
{
// Fuck me, this runs!!!
}
?>
<?php
function sortMarketDeals($a, $b)
{
$a = $a['started_at'];
$b = $b['started_at'];
if ($a == $b)
{
return 0;
@joshtronic
joshtronic / spellspeak.sh
Created March 10, 2012 16:32
spell and speak
#!/bin/bash
echo "Press [CTRL+C] to exit..."; echo
os=${OSTYPE//[0-9.]/}
if [[ "$os" == "linux-gnu" ]];
then
speak="espeak -v english-us"
elif [[ "$os" == "darwin" ]];
# Block empty blocked or whitelisted referers
location ~ ^/gallery/(\d+)/(\d+)/(\d+)-(\d+)-(\d+)\.(.+)$
{
valid_referers none blocked scenekids.com ~(google.|yahoo.|bing.|facebook.|fbcdn.);
if ($invalid_referer)
{
return 403;
}
}
RewriteRule ^(cgi-bin|level)(.+)?$ /index.php?request=404 [NC,L]
<?php
// I... hurt my self today
// TODO this isn't good mojo
$comment = new StatusComment();
$comments = array();
foreach ($statuses as $status)
{
$comments[$status['id']] = count($comment->getComments($status['id']));
#!/bin/bash
for file in `find .`
do
EXTENSION="${file##*.}"
if [ "$EXTENSION" == "php" ] || [ "$EXTENSION" == "phtml" ]
then
RESULTS=`php -l $file`