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
#!/usr/bin/env bash | |
HOST=remote.host | |
IFACE=127.0.0.1 | |
PORT=1234 | |
SOCKET=remote-docker-socket.${HOST} | |
ssh -M -S ${SOCKET} -o ExitOnForwardFailure=yes -fNTL ${IFACE}:${PORT}:/var/run/docker.sock ${HOST} && ( | |
DOCKER_HOST=tcp://${IFACE}:${PORT} docker-compose $* | |
ssh -S ${SOCKET} -O exit ${HOST} 2> /dev/null |
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 func($param) { | |
return $param; | |
} | |
class A | |
{ | |
public static function staticMethod($param) { | |
return $param; | |
} |
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
angular.module("yourApp").provider("$stateProviderWrapper", function ($stateProvider, $injector) { | |
var stack = { | |
"":{} | |
}; | |
return { | |
$get:function () { | |
}, | |
state:function (name, definition) { |
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 | |
$url = "https://docs.google.com/..."; | |
$rows = array_map( | |
'str_getcsv', | |
explode( | |
"\n", | |
`wget --no-check-certificate -O - -nv -q "$url"` | |
) | |
); | |
?> |
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 get_goodle_drive_spreadsheet($url) { | |
try { | |
// We are going to use temporary file: | |
$fh = fopen("php://temp", "w+"); | |
if (!$fh) { | |
throw new Exception("Can't open temporary file"); | |
} | |
$ch = curl_init($url); |