- find local files and
git mvthem:find . -name '*foo*' -exec sh -c 'file={}; git mv $file ${file/foo/bar}' \; - remove a local branch:
git branch -d <branchName> - remove a remote branch from the server:
git push origin :<branchName> - as of git v1.7.0:
git push origin --delete
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
| language: php | |
| php: | |
| - 5.6 | |
| - 7 | |
| matrix: | |
| include: | |
| - php: 5.6 | |
| env: dependencies=lowest |
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 | |
| // https://www.darklaunch.com/2009/07/31/base36-encode-and-decode-using-php-with-example-base36-encode-base36-decode | |
| function base36_encode($base10) { | |
| return base_convert($base10, 10, 36); | |
| } | |
| function base36_decode($base36) { | |
| return base_convert($base36, 36, 10); |
Accept insecure https and use basic auth:
curl -k --user name:password https://www.example.com
curl --user name:password https://www.example.com
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
| @function map-fetch($map, $keys...) { | |
| @each $key in $keys { | |
| $map: map-get($map, $key); | |
| @if type-of($map) == 'null' { | |
| @return $map; | |
| } | |
| } | |
| @return $map; |
curl -X :///
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 | |
| ini_set('display_errors', 1); | |
| require __DIR__ . '/vendor/autoload.php'; | |
| $json = '{ | |
| "shipping_address": { | |
| "street_address": "1600 Pennsylvania Avenue NW", | |
| "city": "Washington", | |
| "state": "DC" | |
| }, |
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 | |
| ini_set('display_errors', 1); | |
| require __DIR__ . '/vendor/autoload.php'; | |
| $json = '{ | |
| "address": { | |
| "street_address": "1600 Pennsylvania Avenue NW", | |
| "city": "Washington", | |
| "state": "DC", | |
| "use_for_billing": true |
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
Is a useful one-liner which will give you the full directory name of the script no matter where it is being called from
These will work as long as the last component of the path used to find the script is not a symlink (directory links are OK). If you want to also resolve any links to the script itself, you need a multi-line solution:
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
<img src="fallback-placeholder-image.jpg"
srcset="largest-image.jpg 960w,
larger-image.jpg 640w,
medium-image.jpg 480w,
smallest-image.jpg 320w"
sizes="(min-width: 1280px) 480px,
(min-width: 1024px) 444px,