Skip to content

Instantly share code, notes, and snippets.

View Demonstrandum's full-sized avatar

Samuel Demonstrandum

View GitHub Profile
@Demonstrandum
Demonstrandum / payload.php
Last active June 3, 2017 13:51
GitHub's webhooks for repositories, in PHP and sh.
<?php
header("Content-type: text/plain");
if ( $_POST['payload'] ) {
shell_exec("./pull");
}
?>
@Demonstrandum
Demonstrandum / lambda_fizzbuzz.py
Last active June 3, 2017 13:49
Lambda for FizzBuzz in Python
fizzbuzz = (
lambda n: 'fizzbuzz' if n % 15 == 0 else ('fizz' if n % 3 == 0 else ('buzz' if n % 5 == 0 else str(n) ))
)
# Interactivity
if __name__ == '__main__':
import sys
if len(sys.argv) == 1:
print('Give command line arguments of number to fizzbuzz.')
exit(1)