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
## | |
# Determine if a given element exists in an array. | |
# | |
# Based on: | |
# https://stackoverflow.com/a/11525897/4342230 | |
# | |
# @param string $1 | |
# The value to look for (the "needle"). | |
# @param string... $2... | |
# The array of values to search (the "haystack"). |
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 | |
// NOTE: Node previews expire after 7 days. Be sure to use this method to extract the desired data before then. | |
// IMPORTANT: Set this to the user ID of the person who was creating/lost the node. | |
$user_id = 1; | |
// IMPORTANT: Set this to the UUID that appeared in the node preview URL. | |
// This value is from a URL that looked like this: | |
// https://my-site/node/preview/ed4eaac0-3c32-427e-860f-6ce8fc79c3b2/full | |
$preview_id = 'ed4eaac0-3c32-427e-860f-6ce8fc79c3b2'; |
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
On PHP 7.2.24-0ubuntu0.18.04.1 (cli) (built: Oct 28 2019 12:07:07) ( NTS ): | |
ClassA = 1576680836 | |
ClassA = 1576680836 | |
ClassA = 1576680838 | |
ClassA = 1576680838 | |
ClassA = 1576680840 | |
ClassA = 1576680840 | |
ClassX = 1576680842 |
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
On PHP 7.2.24-0ubuntu0.18.04.1 (cli) (built: Oct 28 2019 12:07:07) ( NTS ): | |
Array | |
( | |
[a] => ABC: 1 | |
[b] => ABC: 2 | |
) | |
,1,2 |
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
On PHP 7.2.24-0ubuntu0.18.04.1 (cli) (built: Oct 28 2019 12:07:07) ( NTS ): | |
Result of combining: | |
Array | |
( | |
[0] => 1 | |
[1] => 2 | |
[2] => 3 | |
) | |
...with: |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>My Slightly More Advanced Page</title> | |
</head> | |
<body> | |
<h1>A Slightly More Advanced Simple Page</h1> | |
<p id="my_paragraph"></p> |
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
var tagAttribute = 'data-tag-for-query'; | |
$(elements).each(function() { | |
$(this).attr(tagAttribute, 'true'); | |
}); | |
var nodes = document.querySelectorAll('[' + tagAttribute + '="true"]'); | |
Array.prototype.forEach.call(nodes, function(node) { | |
$(node).removeAttr(tagAttribute); |
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 | |
// Run this command in three separate consoles, concurrently. | |
// - Run the first with php -f ./test.php 1 | |
// - Run the second with php -f ./test.php 2 | |
// - Run the second with php -f ./test.php 3 | |
$prefix = $argv[1]; | |
for ($value = 0; $value < 1000; ++$value) { | |
$sleep_amount = rand(50000, 250000); |
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
The default username and password for a Technicolor CGA4234 VGW from AtlanticBBInc is "user" with no password. |
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
# This trick keeps the kubectl session active by printing the current time every 10 seconds | |
# | |
# Run commands like this | |
(while true; do sleep 10; date; done) & <YOUR LONG RUNNING COMMAND GOES HERE> | |
# For example: | |
(while true; do sleep 10; date; done) & sha512sum my_super_large_file.dat | tee checksum.sha512 | |
# When done, to get control back, run this command: | |
fg |