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 | |
| namespace Vendor\Bundle\Twig; | |
| /* | |
| services.yml: | |
| twig.base64: | |
| class: Vendor\Bundle\Twig\Base64 | |
| tags : | |
| - { name: twig.extension } |
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 | |
| namespace Vendor\Bundle\Twig; | |
| /* | |
| services.yml: | |
| twig.md5: | |
| class: Vendor\Bundle\Twig\Md5 | |
| tags : | |
| - { name: twig.extension } |
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
| Recursively generate MD5 checksums | |
| Posted 10-26-2011 at 10:53 AM by Garda | |
| Tags find, md5, md5sum, xargs | |
| I wanted to generate MD5 checksums of a whole bunch of files in a directory. It turns out that this is not as straightforward as it should be. IMO it should be completed with: md5sum -br * | |
| Unfortunately it was not as straightforward. I found this blog entry after searching for a while and adapted this to what I needed. To generate checksums, I used the following: | |
| Code: | |
| find . -type f -print0 | xargs -0 md5sum -b | |
| (Note: for the above to work, "cd" to the top level directiory, or use "find /home/username/folder/" instead of "find .") |
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
| [core] | |
| excludesfile = /home/user/git/.gitignore_global | |
| autocrlf = input | |
| [alias] | |
| ls = log -30 --pretty=format:\"%C(yellow)%h %C(blue)%ad%C(red)%d %C(reset)%s%C(green) [%cn]\" --decorate --date=short | |
| c = commit -am | |
| co = checkout | |
| b = branch | |
| s = status | |
| d = diff |
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
| #!~/.bashrc | |
| # Get shell to a container by it's name. | |
| function dsh() { docker exec -it $(docker ps | grep $1 | cut -d" " -f1) /bin/bash;} | |
| function php() { docker run --rm -v $PWD:/php php:5.5 php /php/$1; } | |
| function vssh { | |
| vagrant ssh -c "sudo /bin/bash -c $1" | |
| } |
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 | |
| $input = "0B012722900021AC35B2"; | |
| $output = "0B012722900021AC35B21"; | |
| function luhn16($input) { | |
| $codeArray = array(); | |
| $lastNumeric = array(); | |
| // Step 1: Code Point mapping (hex2int) |
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
| #!/bin/bash | |
| # Check interval seconds | |
| CHECKINTERVAL=0.05 | |
| # console | |
| CONSOLE=/dev/console | |
| #indicator to use [caps, num, scroll] | |
| INDICATOR=scroll |
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
| $.ajax({ | |
| url:postURL, | |
| type:"POST", | |
| data:JSON.stringify(data), | |
| contentType:"application/json; charset=utf-8", | |
| dataType:"json" | |
| }) |
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 | |
| // Link: https://ideone.com/JBQDNw | |
| // PHP 5.4 required! | |
| trait Overload { | |
| public function overloadMe() { | |
| $caller = debug_backtrace(false , 2)[1]; | |
| $function = $caller['function']; |
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
| ^(07|447|\+447|00447)\d{9}$ |