Skip to content

Instantly share code, notes, and snippets.

@metashock
metashock / pytest_mock_api.py
Last active Jan 20, 2016
How to mock an external API with pytest_mock
View pytest_mock_api.py
class Api():
def persons(self):
return ['hek2mgl', 'lgm2keh']
class App(Api):
def hello_messages(self):
msg = []
@metashock
metashock / get_request_uri
Last active Aug 29, 2015
PHP - Get Request Uri
View get_request_uri
function get_request_uri() {
$url = 'http';
if(isset($_SERVER['https']) && $_SERVER['https'] == 'on') {
$url .= 's';
}
$url .= '://';
$url .= $_SERVER['SERVER_NAME'];
@metashock
metashock / mkalien.sh
Created Aug 14, 2014
Make alien out of linux binary
View mkalien.sh
#!/bin/bash
if [ $# != 2 ] ; then
echo "usage $0 PATH_TO_BINARY TARGET_FOLDER"
exit 1
fi
PATH_TO_BINARY="$1"
TARGET_FOLDER="$2"
You can’t perform that action at this time.