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
user nginx; | |
worker_processes auto; | |
error_log /var/log/nginx/error.log notice; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} |
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
function tv2e | |
switch "$argv" | |
case 'a' | |
echo "playfe" | |
case 'b' | |
echo "is" | |
case 'c' | |
echo "cms" | |
case 'd' | |
echo "app" |
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
#!/bin/bash | |
if [ $(curl -s -H "Accept: application/json" https://tvtid-backend.tv2.dk/tvtid-app-backend/schedules/channels | grep "{},") ]; then | |
echo "It's bad!!" | |
else | |
echo "It's good!" | |
fi |
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
#!/bin/bash | |
docker stop $(docker ps -aq --filter status=running) | |
docker rm $(docker ps -aq) | |
docker rmi $(docker images -q) |
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
#!/bin/bash | |
docker rm $(docker ps -aq --filter status=exited) | |
docker rmi $(docker images -f "dangling=true" -q) |
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
#!/opt/local/bin/php | |
<?php | |
function getDirectoryList($dir, $skipExtensions = []) { | |
$dirList = $fileList = []; | |
if ($dfp = opendir($dir)) { | |
while (($entry = readdir($dfp)) !== false) { | |
$skip = false; | |
foreach ($skipExtensions as $extension) { | |
if (substr($entry, strlen($entry) - strlen($extension)) === $extension) { |
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/php | |
<?php | |
/** | |
* Usage: tail -f /var/log/apache2/error.log | php-log-highlight | |
*/ | |
ini_set('display_errors', E_ALL & ~E_STRICT); | |
// Dependencies | |
require_once 'Console/Color.php'; |
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 | |
$lol = null; | |
$$lol->enabled = true; | |
var_dump($$lol); | |
var_dump($lol); | |
/* Output: | |
PHP Strict Standards: Creating default object from empty value in /Users/ibmurai/lol.php on line 4 |
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
(function($) { | |
$.fn.lol = function() { | |
var scope = function($this) { | |
var f = { | |
/** | |
* The "constructor" | |
*/ | |
init : function() { | |
console.log('init'); |
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 | |
/* This handy script lets you locate escaped backslashes in the prettiest way. */ | |
$input = $_POST['value']; | |
$matches = array(); | |
if (preg_match("/\\\\/", $input, $matches)) { | |
var_dump($matches); | |
} else { |