graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
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 | |
| // Interestingly, a null value in an isset() check will return false | |
| $r = array( | |
| "a" => 1, | |
| "b" => null | |
| ); | |
| echo "a: ".(isset($r['a']) ? 'Yes' : 'No').PHP_EOL; |
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
| kilo% ls ~/.zsh/completions | |
| _hub | |
| kilo% echo $fpath | |
| /home/michael/.zsh/completion /usr/local/share/zsh/site-functions /usr/share/zsh/vendor-functions /usr/share/zsh/vendor-completions /usr/share/zsh/functions/Calendar /usr/share/zsh/functions/Chpwd /usr/share/zsh/functions/Completion /usr/share/zsh/functions/Completion/AIX /usr/share/zsh/functions/Completion/BSD /usr/share/zsh/functions/Completion/Base /usr/share/zsh/functions/Completion/Cygwin /usr/share/zsh/functions/Completion/Darwin /usr/share/zsh/functions/Completion/Debian /usr/share/zsh/functions/Completion/Linux /usr/share/zsh/functions/Completion/Mandriva /usr/share/zsh/functions/Completion/Redhat /usr/share/zsh/functions/Completion/Solaris /usr/share/zsh/functions/Completion/Unix /usr/share/zsh/functions/Completion/X /usr/share/zsh/functions/Completion/Zsh /usr/share/zsh/functions/Completion/openSUSE /usr/share/zsh/functions/Exceptions /usr/share/zsh/functions/MIME /usr/share/zsh/functions/Misc /usr/share/zsh/functions/Newuser /usr/share/zsh/functi |
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
| func oddNumberGenerator(n int) []int { | |
| vals := make([]int, n); | |
| origN := n; | |
| // In PHP I'd do while count($arr) < $n, but as we initialise | |
| // an array of size n that won't work in go | |
| for i := 0; n > 0; i++ { | |
| if (i % 2 == 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
| # Install it | |
| Add to composer: | |
| "symfony/dependency-injection": "2.4.2", | |
| "symfony/yaml": "2.4.2", | |
| # Configure it | |
| <?php |
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
| var http = require('http'); | |
| http.createServer(function (req, res) { | |
| res.writeHead(200, {'Content-Type': 'text/plain'}); | |
| res.end('{"success":true}'); | |
| }).listen(9615); |
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 | |
| $ritit = new RecursiveIteratorIterator(new RecursiveArrayIterator($myArray)); | |
| $result = array(); | |
| foreach ($ritit as $leafValue) { | |
| $keys = array(); | |
| foreach (range(0, $ritit->getDepth()) as $depth) { | |
| $keys[] = $ritit->getSubIterator($depth)->key(); | |
| } | |
| $result[ join('.', $keys) ] = $leafValue; | |
| } |
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
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 | |
| set -o errexit | |
| # Author: David Underhill | |
| # Script to permanently delete files/folders from your git repository. To use | |
| # it, cd to your repository's root and then run the script with a list of paths | |
| # you want to delete, e.g., git-delete-history path1 path2 | |
| if [ $# -eq 0 ]; then | |
| exit 0 |
I really struggled to get this working. I initially found https://gist.github.com/1990736 but it wasn't working for me, so I decided to throw it out, copy the original JST task and adapt it.
The jsthb helper has been lifted entirely from https://gist.github.com/1990736, the rest I've hacked at myself. This has been tested with both ajax loading and a release build.