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
| #################################################################################### | |
| ## ## | |
| ## gittyup() - Easily keep master in sync with upstream. ## | |
| ## ## | |
| ## Author: Evan Coury, http://blog.evan.pro/ ## | |
| ## URL: https://gist.github.com/1506822 ## | |
| ## ## | |
| ## This bash function is a simple shortcut for keeping your local (and public ## | |
| ## fork / origin remote) master branch up to date and in sync with the upstream ## | |
| ## master. To use gittyup(), simply drop this in your ~/.bashrc. ## |
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
| # This is how I built the list: | |
| curl -s -O http://s3.amazonaws.com/alexa-static/top-1m.csv.zip ; unzip -q -o top-1m.csv.zip top-1m.csv ; head -1000 top-1m.csv | cut -d, -f2 | cut -d/ -f1 > topsites.txt | |
| # Always fun to see how complicated you can make a one-liner! | |
| i=1; cat topsites.txt | while read line; do D=$line; result=$(whois "domain $D" 2>&1); while [[ $result =~ "fgets: Connection reset by peer" ]]; do result=$(whois "domain $D" 2>&1); done; godaddy=$(echo $result | grep -i "godaddy" | wc -l); echo -ne "$i.\t"; if [[ $godaddy > 0 ]]; then echo "Y - $D"; else echo "N - $D"; fi; i=$(($i+1)); done; |
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 | |
| // All PHP files start with <?php | |
| // Two slashes is a comment, as you can see. | |
| // We are going to start with variables. | |
| // Variables are just like, a "container" to hold values. | |
| // All variables in PHP start with a $ sign. | |
| // Their names must start with a letter, not a number | |
| $name = "Max"; // This is a string |
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
| <html> | |
| <head> | |
| <title>Fishing Map - Fish Connection</title> | |
| <style> | |
| body { | |
| background-color: #383838; | |
| margin: 0px; | |
| padding: 0px; | |
| height: 100%; | |
| display: flex; |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| #!/usr/bin/env sh | |
| ## | |
| ## lrn2bash - Show a random manpage. | |
| ## | |
| ## Author: Evan Coury, http://blog.evan.pro/ | |
| ## URL: https://gist.github.com/EvanDotPro/5149068 | |
| ## | |
| ## Installation or Upgrade: | |
| ## | |
| ## mkdir -p ~/bin && rm -f ~/bin/lrn2bash && wget -q https://gist.github.com/EvanDotPro/5149068/raw/lrn2bash -O ~/bin/lrn2bash && chmod +x ~/bin/lrn2bash |
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 Lesson1; | |
| class Module | |
| { | |
| public function getAutoloaderConfig() | |
| { | |
| return array( | |
| 'Zend\Loader\StandardAutoloader' => array( | |
| 'namespaces' => array( |
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 | |
| public function addAction() { | |
| $form = new \Zebreco\Form\Contact(); | |
| if ($this->getRequest()->isPost()) { | |
| $service = $this->getServiceLocator()->get('Zebreco\Service\Contact'); | |
| $form->setData($this->getRequest()->getPost()); | |
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 Application\Di; | |
| use Zend\Di\Locator; | |
| class Di implements Locator | |
| { | |
| protected $classes = array(); |
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
| [ecoury@evan-laptop zf2 (master)]$ find ./library/Zend -type f -name '*.php' | xargs grep -ne '@[A-Za-z_][A-Za-z0-9_]*(' | |
| ./library/Zend/Ldap/Ldap.php:162: $ret = @ldap_get_option($this->_resource, LDAP_OPT_ERROR_NUMBER, $err); | |
| ./library/Zend/Ldap/Ldap.php:191: $estr1 = @ldap_error($this->_resource); | |
| ./library/Zend/Ldap/Ldap.php:193: $estr1 = @ldap_err2str($errorCode); | |
| ./library/Zend/Ldap/Ldap.php:199: @ldap_get_option($this->_resource, LDAP_OPT_ERROR_STRING, $estr2); | |
| ./library/Zend/Ldap/Ldap.php:646: @ldap_unbind($this->_resource); | |
| ./library/Zend/Ldap/Ldap.php:719: $resource = ($useUri) ? @ldap_connect($this->_connectString) : @ldap_connect($host, $port); | |
| ./library/Zend/Ldap/Ldap.php:726: if (@ldap_set_option($resource, LDAP_OPT_PROTOCOL_VERSION, 3) && | |
| ./library/Zend/Ldap/Ldap.php:727: @ldap_set_option($resource, LDAP_OPT_REFERRALS, $optReferrals)) { | |
| ./library/Zend/Ldap/Ldap.php:728: if ($useSsl || !$useStartTls |
NewerOlder