Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
<?php | |
class DemoSubject implements SplSubject{ | |
private $observer, $value; | |
public function __construct(){ | |
$this->observers = array(); | |
} | |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
#!/bin/bash | |
# Might as well ask for password up-front, right? | |
sudo -v | |
# Keep-alive: update existing sudo time stamp if set, otherwise do nothing. | |
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & | |
# Example: do stuff over the next 30+ mins that requires sudo here or there. | |
function wait() { |
WARNING : This code now lives in its own github repository: lovasoa/fast_array_intersect. It is also published on npm: fast_array_intersect
""" | |
Settings for root logger. | |
Log messages will be printed to console and also to log file (rotated, with | |
specified size). All log messages from used libraries will be also handled. | |
Three approaches for defining logging settings are used: | |
1. using logging classes directly (py25+, py30+) | |
2. using fileConfig (py26+, py30+) | |
3. using dictConfig (py27+, py32+) | |
Choose any variant as you like, but keep in mind python versions, that |
################################################################################# | |
# start and stop the vpn from the command line from now on with these two commands | |
# or rename the aliases as you see fit. | |
################################################################################# | |
alias startvpn="sudo launchctl load -w /Library/LaunchDaemons/net.juniper.AccessService.plist; open -a '/Applications/Junos Pulse.app/Contents/Plugins/JamUI/PulseTray.app/Contents/MacOS/PulseTray'" | |
alias quitvpn="osascript -e 'tell application \"PulseTray.app\" to quit';sudo launchctl unload -w /Library/LaunchDaemons/net.juniper.AccessService.plist" |
<?php | |
use GuzzleHttp\Client; | |
trait MailTestHelper | |
{ | |
/** | |
* @var \GuzzleHttp\Client | |
*/ | |
protected $client; |
There are several common ways to do rsync backups of hosts over ssh:
Here is another option t