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
#!/usr/bin/env php | |
<?php | |
class Forwarder | |
{ | |
private $offset = 0; | |
private $limit = 100; | |
private $timeout = 120; | |
private $botToken; | |
private $webHook; |
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 | |
final class Days | |
{ | |
const MONDAY = 1; | |
const TUESDAY = 2; | |
const WEDNESDAY = 3; | |
const THURSDAY = 4; | |
const FRIDAY = 5; | |
const SATURDAY = 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
country=US | |
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev | |
update_config=1 | |
network={ | |
ssid="your_real_wifi_ssid" | |
scan_ssid=1 | |
psk="your_real_password" | |
key_mgmt=WPA-PSK | |
} |
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
#! /usr/bin/env bash | |
sudo apt-get install -y libncursesw5-dev autopoint texinfo autoconf dh-autoconf | |
cd /tmp | |
git clone git://git.savannah.gnu.org/nano.git | |
cd nano | |
./autogen.sh | |
./configure | |
sudo make install |
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 | |
use IainConnor\ComposerPthreads\AutoloadWorker; | |
use IainConnor\ComposerPthreads\ResponseDataBundle; | |
use Pool; | |
use React\EventLoop\LoopInterface; | |
use React\Promise\Deferred; | |
use React\Promise\PromiseInterface; | |
class Executor |
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
# | |
# Launches configured Graylog 2.3.1 instance | |
# | |
# - Docker-compose 1.16 required | |
# - Please configure following according to your network: | |
# * gelf-address URL (for each container) | |
# * GRAYLOG_WEB_ENDPOINT_URI | |
# - After launch define GELF tcp and GELF udp inputs in graylog web ui | |
# - Containers send logging to the graylog itself | |
# - By default tuned to 30 days retention |
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
export function memoize(target: any, prop: string, descriptor: PropertyDescriptor) | |
{ | |
let original = descriptor.get; | |
descriptor.get = function (...args: any[]) | |
{ | |
const privateProp = `__memoized_${prop}`; | |
if (!this.hasOwnProperty(privateProp)) { | |
Object.defineProperty(this, privateProp, { |
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
#!/usr/bin/env php | |
<?php | |
file_put_contents($argv[1], json_encode(json_decode(file_get_contents($argv[1]), 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
// url should always match template: host/path | |
std::string url_get_contents(std::string url) | |
{ | |
using namespace boost::asio; | |
ip::tcp::iostream stream; | |
auto tokens = explode("/", url); | |
auto host = tokens[0]; | |
auto request = tokens[1]; |
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-get update && \ | |
sudo apt-get install build-essential software-properties-common -y && \ | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ | |
sudo apt-get update && \ | |
sudo apt-get install gcc-snapshot -y && \ | |
sudo apt-get update && \ | |
sudo apt-get install gcc-6 g++-6 -y && \ | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6 && \ | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5; |
NewerOlder