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
<? | |
// Usage: | |
echo "I have ".return_indefinitearticle("apple")." apple, and ".return_indefinitearticle("slice of bread")." slice of bread."; | |
function return_indefinitearticle($thing) { | |
return (preg_match('/^[aeiou]|s\z/i', strtolower($thing))) ? "an" : "a"; | |
} | |
?> |
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
Sun, 17 Jan 2038 14:26:09 GMT | |
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
/* 1. Search in discussions_users for user, and remember their ID and email. */ | |
/* Here's the SQL query... */ | |
SELECT username AS from_user, FROM_UNIXTIME(`privmsgs_date`) AS sent, privmsgs_subject, privmsgs_text FROM `discussions_privmsgs` LEFT JOIN discussions_privmsgs_text on privmsgs_id=privmsgs_text_id LEFT JOIN discussions_users ON privmsgs_from_userid=user_id WHERE `privmsgs_to_userid` = 28861 | |
/*... export this as PDF, then send it to user's ID.*/ | |
/* posts are */ | |
SELECT topic_title,post_subject,post_text,post_time FROM `discussions_posts` JOIN discussions_posts_text ON discussions_posts.post_id = discussions_posts_text.post_id JOIN discussions_topics ON discussions_topics.topic_id=discussions_posts.topic_id WHERE `poster_id` = 18852 |
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
#put this bit in your .htaccess file | |
RewriteCond %{HTTP_REFERER} ^http://(www\.)?godalmingtownfc.co.uk.*$ [NC,OR] | |
RewriteCond %{HTTP_REFERER} ^http://(www\.)?mallulive.com.*$ [NC,OR] | |
RewriteCond %{HTTP_REFERER} ^http://(www\.)?allegro.pl.*$ [NC,OR] | |
RewriteCond %{HTTP_REFERER} ^http://(www\.)?lawiki.org.*$ [NC,OR] | |
RewriteCond %{HTTP_REFERER} ^http://(www\.)?pcworld.com.*$ [NC] | |
ReWriteRule .*\.png$ - [F] |
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
<? | |
$url['url']='https://plus.google.com/107170242245169064947/posts'; | |
if (isset($url['url'])) { | |
$d = new DOMDocument(); | |
@$d->loadHTML(file_get_contents($url['url'])); | |
$xpath = new DOMXPath($d); |
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
<!-- | |
Put this just under your <HEAD> in HTML. | |
Note - it displays once, and once only. | |
It requires you to run Google Analytics on your website. | |
If a user deletes their cookies, it'll appear again. | |
You can test it by going into Incognito Mode. | |
--> | |
<script type='text/javascript'> |
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
<?xml version="1.0"?> | |
<root> | |
<devicevendordef> | |
<vendorname>LOGITECH</vendorname> | |
<vendorid>0x046d</vendorid> | |
</devicevendordef> | |
<deviceproductdef> | |
<productname>LOGITECH_R800</productname> | |
<productid>0xc538</productid> |
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 | |
// A small piece of code to check the Last-Modified header in PHP | |
// The below currently (on 16 October) returns: | |
// "Tue, 11 Oct 2016 11:26:59" | |
// ... so that's when it was last updated. | |
// I'm told that this URL is a permanent link. My assumption is that any update to the | |
// DAB, FM or AM data will produce an update for this main file; even though my own code | |
// actually just uses the .csv files. |
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
$re = '/[\*].*(gimlet)(.+?\n\n)/'; | |
$str = '* Google Play Music have [buttons for your podcasts](https://play.google.com/intl/en_us/badges-music/). Note, however, that outside the US, they just redirect to the front page of Google Play. One step forward, one step back. | |
* Recommended: [ReplyAll investigates Facebook](https://gimletmedia.com/episode/109-facebook-spying/) using your phone\'s microphone to spy on your conversations. And, how to stop them doing it, even though they\'re not. | |
* Event: on now in Austin TX, USA: [Media Tech Week](https://mediatechweek.live/)'; | |
preg_match($re, $str, $matches); | |
var_dump($matches); |
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 include('../_connect.php');?> | |
<?php include('../../includes/helpers/short.php');?> | |
<?php | |
/* | |
---Little helper function from [email protected] for reporting | |
Put this file in a new folder within the /api/ folder, called "reporting", and call it "reports.php". (Or whatever you like). | |
Call by POST to api/reporting/reports.php with the following mandatory elements | |
'api_key' => (your API key) | |
'brand_id' => 1 | |
'label' => (the campaign name) |
OlderNewer