Skip to content

Instantly share code, notes, and snippets.

Avatar

Evan Coury EvanDotPro

View GitHub Profile
View hello.php
<?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
View index.html
<html>
<head>
<title>Fishing Map - Fish Connection</title>
<style>
body {
background-color: #383838;
margin: 0px;
padding: 0px;
height: 100%;
display: flex;
@EvanDotPro
EvanDotPro / 0_reuse_code.js
Created Mar 30, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View git-support-golf.md

Git Support Golf

A stupid game by Evan Coury to test and improve your git troubleshooting skills.

How to Play

A new round begins the moment a peer comes to you for help with a git problem.

  • The person asking for help may initially explain the nature of their problem, but not provide the output of any git commands at first.
  • Decide what par level the issue should be. Here are some examples:
View keybase.md

Keybase proof

I hereby claim:

  • I am EvanDotPro on github.
  • I am EvanDotPro (https://keybase.io/EvanDotPro) on keybase.
  • I have a public key whose fingerprint is 9E54 6661 BEED F91D 330C F5DB F2B2 F699 BDC5 3788

To claim this, I am signing this object:

@EvanDotPro
EvanDotPro / lrn2bash
Last active Dec 14, 2015
Little script to show a random manpage for a standard bash command.
View lrn2bash
#!/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
View Module.php
<?php
namespace Lesson1;
class Module
{
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
View gist:3090469
<?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());
@EvanDotPro
EvanDotPro / Di.php
Created Feb 24, 2012
Static DI locator replace for ZendSkeletonApplication for benchmarking purposes.
View Di.php
<?php
namespace Application\Di;
use Zend\Di\Locator;
class Di implements Locator
{
protected $classes = array();
View top-1000-godaddy-domains.sh
# 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;