Skip to content

Instantly share code, notes, and snippets.

View TakesTheBiscuit's full-sized avatar

Paul TakesTheBiscuit

View GitHub Profile
@TakesTheBiscuit
TakesTheBiscuit / payload_templated_inputs.php
Created February 9, 2018 21:31
Payload templated inputs for semi dynamic API responses and input cycle
<?php
// P.D / TakesTheBiscuit proof of concept 9-2-2018 21:00
// This small demo shows how you can send an input template
// .. back to an api client (for example) which can then be auto populated
Class micro_api {
public function getResponse($input_id) {
#include <Servo.h>
Servo myservo; // create servo object to control a servo
int pos = 0; // variable to store the servo position
String inputString = ""; // a String to hold incoming data
@TakesTheBiscuit
TakesTheBiscuit / lookup.php
Created September 15, 2017 12:16
Police UK postcode lookup
<?php
$addresses = explode('||',file_get_contents('https://ukpoliceimageappeal.co.uk/postcode/lookup?code=m146pb'));
if (count($addresses)) {
foreach ($addresses as $address) {
echo str_replace('//',', ',str_replace(' ','',$address));
echo "<hr>";
}
}
?>
@TakesTheBiscuit
TakesTheBiscuit / composer.json
Created August 30, 2017 11:13
Autoload metapack php shipping library wrapper client using composer
{
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
},
"files": ["app/Libraries/metapack_client_v5.php"]
<?php
// just because this isn't wordpress..
$dummy_post = array('title'=>'the post name', 'body'=>'some post content');
$posts = array($dummy_post ,$dummy_post ,$dummy_post,$dummy_post,$dummy_post,$dummy_post );
$track_count = 0;
$posts_output = [];
foreach ($posts as $index => $post) {