This file contains hidden or 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
set -e | |
if [ $# -eq 0 ]; then echo "No command specified\nAvailable commands:\n* remove [attribute_name]\n* commit\n"; exit; fi | |
if [ $1 = "remove" ]; then | |
if [ $# -eq 1 ]; then | |
echo "No attribute_name specified to remove\n" | |
exit | |
fi |
This file contains hidden or 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 | |
//polyfill for missing hash_equals | |
if(!function_exists('hash_equals')) | |
{ | |
function hash_equals($str1, $str2) | |
{ | |
if(strlen($str1) != strlen($str2)) | |
{ | |
return false; | |
} |
This file contains hidden or 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 | |
//load VDF data either from API call or fetching from file/url | |
//no matter your method, $json must contain the VDF data to be parsed | |
$json = file_get_contents("items_game.txt"); | |
//encapsulate in braces | |
$json = "{\n$json\n}"; | |
//replace open braces | |
$pattern = '/"([^"]*)"(\s*){/'; |
This file contains hidden or 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
$(document).ready(function () { | |
var str = "H:\\Informatique\\Personnalisation\\Icones\\__\\Crystal GT PNG Pack\\Applications\\licq.png"; | |
var maxLength = 25; | |
var tokens = str.split("\\"); | |
var drive = tokens[0]; | |
var fileName = tokens[tokens.length - 1]; | |
var len = drive.length + fileName.length; | |
//remove the current lenth and also space for 3 dots and 2 slashes | |
var remLen = maxLength - len - 5; |