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
root@bf1:/etc/init.d# cat liquidsoap | |
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: liquidsoap | |
# Required-Start: $remote_fs $network $time | |
# Required-Stop: $remote_fs $network $time | |
# Should-Start: | |
# Should-Stop: | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 |
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
sudo echo "deb https://download.docker.com/linux/ubuntu zesty edge" > /etc/apt/sources.list.d/docker.list | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7EA0A9C3F273FCD8 | |
sudo apt update && sudo apt install docker-ce |
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
sudo apt install -y byobu | |
sudo purge-old-kernels -y --keep 1 | |
sudo apt-get -y autoremove --purge |
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
public function splice($html, $new, $tag) { | |
$html = $this->getInstanceOfDom($html); | |
$element = $html->getElementById($tag); | |
$doc = new DOMDocument(); | |
$doc->loadHTML('<?xml encoding="UTF-8">' . $new); | |
foreach ($doc->childNodes as $node) { | |
if ($node->nodeType == XML_PI_NODE) { $doc->removeChild($node); } | |
} | |
$xpath = new DOMXPath($doc); | |
$body = $xpath->query('/html/body'); |
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
$combined = combine2ArraysByKey($featured_properties, $property_records, "L_ListingID"); | |
function combine2ArraysByKey($first, $second, $key) { | |
$combined = []; | |
$first = (array) array_column($first, NULL, $key); | |
$second = (array) array_column($second, NULL, $key); | |
foreach($first as $key=>$items) { | |
if ( !empty($second[$key]) ) $combined[$key] = array_merge((array) $items, (array) $second[$key]); | |
} | |
return $combined; |
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 | |
error_reporting(E_ALL); | |
$haystack = "An apple a day"; | |
$needles = array("An", "da", "pp"); | |
$array_of_starting_positions = findAnyNeedles($haystack, $needles, false); // This returns string by default. | |
header("Content-type: text/plain"); |
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
sudo systemctl disable systemd-resolved | |
sudo systemctl stop systemd-resolved | |
sudo ls -lh /etc/resolv.conf | |
sudo rm /etc/resolv.conf | |
sudo echo "nameserver 1.1.1.1" > /etc/resolv.conf | |
sudo apt-get update | |
sudo apt-get install pdns-server pdns-backend-mysql |
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
$objects = $rets->Search('Property', 'RE_1', '(L_ListingID=1800394)'); | |
$test = get_class_methods($objects); | |
print_r($test); | |
// GIVES: | |
/* | |
Array |
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 | |
$raw_content = file_get_contents("NBA_example.txt"); | |
$dom = new DOMDocument; | |
$dom->loadHTML("$raw_content"); | |
$block = $dom->getElementById("oddsGridContainer"); | |
$results = []; | |
$assets = $block->getElementsByTagName('script'); |
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
{ | |
"require": { | |
"troydavisson/phrets": "2.*" | |
} | |
} |