This file contains hidden or 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
// TURN CLOCKWISE, WAIT A BIT, THEN GO ANTI CLOCK DEMO ONLY | |
#include <Servo.h> | |
#define TURN_TIME 1200 | |
Servo myservo; | |
void setup() { | |
myservo.attach(9); |
This file contains hidden or 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
// type a number on the serial commands | |
// zoomkat 10-22-11 serial servo test | |
// type servo position 0 to 180 in serial monitor | |
// or for writeMicroseconds, use a value like 1500 | |
// for IDE 0022 and later | |
// Powering a servo from the arduino usually *DOES NOT WORK*. | |
String readString; | |
#include <Servo.h> | |
Servo myservo; // create servo object to control a servo |
This file contains hidden or 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 | |
// balls becomes an INT | |
$balls = 1; | |
// truthy check (any INTEGER > 0 will be true) | |
if ($balls) { | |
$balls += 1; | |
} | |
// truthy check: $balls is an INTEGER at this point | |
if ($balls) { | |
$balls = true; |
This file contains hidden or 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 | |
// balls becomes an INT | |
$balls = 1; | |
// truthy check | |
if ($balls) { | |
$balls += 1; | |
} | |
// outputs: 2 | |
echo $balls; | |
?> |
This file contains hidden or 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 | |
$discount_that_was_probably_applied = quick_calc_discount_used(1.21,10,11.99); | |
print_r($discount_that_was_probably_applied); | |
function quick_calc_discount_used($fixed = 0, $percent = 0, $sell_price) { | |
$gave_away = 0; | |
$method_used = false; | |
$final_sell = 0; |
This file contains hidden or 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 | |
$stringage = [ | |
'order_id'=>'5678', | |
'name'=>'NO ONE cares' | |
]; | |
echo replace_with_personal_data('There was a problem on order #[order_id] please phone [name]', $stringage); | |
This file contains hidden or 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 | |
$arr = ["7", | |
"13", | |
"4", | |
"5", | |
"13", | |
"18", | |
"28", | |
"7", |
This file contains hidden or 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 | |
$wildcard_array = explode(' ', 'Delivered to neighbouring city signed for by github.com/TAKESTHEBISCUIT'); | |
echo '<pre>'; | |
print_r(reverseWildcard($wildcard_array)); | |
echo '</pre>'; | |
function reverseWildcard($wildcard_arr_of_words) { | |
$working_arr = $wildcard_arr_of_words; | |
$sentences = []; | |
if ($wildcard_arr_of_words != false) { |
This file contains hidden or 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 you are using Composer (recommended) | |
require 'vendor/autoload.php'; | |
// If you are not using Composer | |
// require("path/to/sendgrid-php/sendgrid-php.php"); | |
$from = new \SendGrid\Email("Example User", "[email protected]"); | |
$subject = "Sending with SendGrid is Fun"; | |
$to = new \SendGrid\Email("Example User", "[email protected]"); |
This file contains hidden or 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 | |
$str = json_encode(['test'=>true]); | |
$obj = json_decode($str); | |
var_dump($obj); | |
echo PHP_EOL.'<br>'; | |
$keys = [ | |
'tests', |