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 | |
$choices = array('r', 'p', 's'); | |
$start = microtime(true); | |
$wins = 0; | |
$draws = 0; | |
$losses = 0; | |
$prandom = true; | |
// Get input |
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 | |
# Swaps local docker instances | |
# (I recommend making an alias to call the script) | |
# Directory names will need changing for your needs! | |
function start () { | |
# Change to the chosen directory | |
cd ~/GIT/$1 | |
# Start the chosen containers |
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 | |
# Colour functions | |
function blue($text) { | |
return "\e[;36m$text\e[0m"; | |
} | |
function blue_bold($text) { | |
return "\e[1;36m$text\e[0m"; | |
} |
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 | |
# generates password | |
# Colours | |
function blue($text) { | |
return "\e[;36m$text\e[0m"; | |
} | |
function blue_bold($text) { | |
return "\e[1;36m$text\e[0m"; |
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
https://gist.github.com/lucablackwell/44abc998adfa8d67a08fa99bec2dfcca | |
https://gist.github.com/lucablackwell/44abc998adfa8d67a08fa99bec2dfcca | |
https://gist.github.com/lucablackwell/44abc998adfa8d67a08fa99bec2dfcca | |
https://gist.github.com/lucablackwell/44abc998adfa8d67a08fa99bec2dfcca | |
https://gist.github.com/lucablackwell/44abc998adfa8d67a08fa99bec2dfcca | |
https://gist.github.com/lucablackwell/44abc998adfa8d67a08fa99bec2dfcca | |
https://gist.github.com/lucablackwell/44abc998adfa8d67a08fa99bec2dfcca | |
https://gist.github.com/lucablackwell/44abc998adfa8d67a08fa99bec2dfcca | |
https://gist.github.com/lucablackwell/44abc998adfa8d67a08fa99bec2dfcca | |
https://gist.github.com/lucablackwell/44abc998adfa8d67a08fa99bec2dfcca |
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 | |
# Colours | |
function cyan($text) { | |
return "\e[0;36m$text\e[0m"; | |
} | |
function cyan_bold($text) { | |
return "\e[1;36m$text\e[0m"; | |
} |
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 | |
# Colours | |
function green($text) { | |
return "\e[0;32m$text\e[0m"; | |
} | |
function yellow($text) { | |
return "\e[0;33m$text\e[0m"; | |
} |
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 | |
# Guess the number, input range, returns higher or lower | |
# get the number of games | |
# loop for each game | |
# get the range | |
# assign random number from range | |
# loop while user guesses | |
# if (sanitised) guess is too high or too low, say |
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 | |
# Colours | |
function cyan($text) { | |
return "\e[0;36m$text\e[0m"; | |
} | |
function cyan_bold($text) { | |
return "\e[1;36m$text\e[0m"; | |
} |
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 | |
function sanitise_num($limit, $default) { | |
$sanitised = false; | |
$input = readline('> '); | |
while (!$sanitised) { | |
# If there are letters | |
if (preg_match('/[a-z]/', $input)) { | |
echo "No letters.\n"; | |
$input = readline('> '); |
OlderNewer