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 | |
public static function correctTypes($arr) { | |
foreach ($arr as $key => $value) { | |
if(is_numeric($value)) | |
$arr[$key] = (int) $value; | |
elseif(is_array($value)) | |
$arr[$key] = self::correctTypes($value); | |
} |
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
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(cyan)<%an>%Creset' --abbrev-commit" |
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
find . -name '*.DS_Store' -type f -delete |
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 | |
VHOST_CONF=/etc/apache2/sites-available/ | |
ROOT_UID=0 | |
NOTROOT=87 | |
WWW_ROOT=/var/www/ | |
# owner of the site directory | |
WEBUSER=www-data |
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 | |
$client_id = ""; | |
$image = file_get_contents("tmp.png"); | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, 'https://api.imgur.com/3/image.json'); | |
curl_setopt($ch, CURLOPT_POST, TRUE); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Client-ID ' . $client_id)); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, array('image' => base64_encode($image))); |
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
var pointInPolygon = function(point, polygon) { | |
var x = point[0], y = point[1]; | |
var inside = false; | |
for (var i = 0, j = polygon.length - 1; i < polygon.length; j = i++) { | |
var xi = polygon[i][0], yi = polygon[i][1]; | |
var xj = polygon[j][0], yj = polygon[j][1]; | |
var intersect = ((yi > y) != (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi); |
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
var Checkbox = function($el) { | |
var _this = this; | |
var init = function() { | |
}; | |
var nogEenPrivateFunction = function() { | |
}; |
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 | |
public function provinceByPostalCode($postalCode) | |
{ | |
$province = null; | |
if ($postalCode >= 1000 && $postalCode < 1300) { | |
$province = 'brussels'; | |
} else if ($postalCode < 1500) { | |
$province = 'walloon-brabant'; |
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
/** | |
* Gulpfile | |
*/ | |
var Gulpfile = function() { | |
// Paths | |
var paths = { | |
dest: 'public/**/', | |
scripts: { | |
src: 'resources/scripts/', |
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 | |
// 128KB/100ms | |
$ms = 100; | |
$size = 128; | |
$path = $_GET['path']; | |
if (empty($path)) { | |
return; | |
} |
OlderNewer