Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
</head>
<body>
<?php
$error_messages = array();
array_push($errors, 'Some error');
array_push($errors, 'Another error');
array_push($errors, 'Wow this is bad');
?>
@johnsonch
johnsonch / getting-noticed.md
Last active August 29, 2015 14:14
Getting Noticed - For College Students

#Internships ##Getting Noticed in the Software Community full


#About me fit right

  • Chris Johnson
  • Software Engineer and Scrum Master at GettyImages
@johnsonch
johnsonch / airports.coffee
Created November 13, 2014 04:43
airport demo app, ajax get weather report
getWeather = (url) ->
$("#results").html ""
if url
$.ajax
method: "get"
url: url
success: (data) ->
console.log data
console.log url
return
class ImportAirports
require 'csv'
def self.execute(csv_path)
CSV.foreach(csv_path) do |row|
airport = Airport.new
airport.ident = row[1]
airport.type = row[2]
airport.name = row[3]
airport.latitude_deg = row[4]
airport.longitude_deg = row[5]

Did you know chat rooms are still a thing? They didn't die with AOL. IRC has been around since before the world wide web. IRC has been and continues to be popular for technical communities. There are channels for many frameworks, languages, and conferences.

That Conference's offical channel is #ThatConference on the FreeNode Network. Join Us!

But what is it?

IRC stands for Internet Relay Chat. IRC is an open standard. No one person or company "owns" it. An IRC network is a decentralised cluster of servers. Servers are typically distrubed around the world. IRC clients connects to one of the servers in the cluster and joins channels (chat rooms) to communicate. Users send messages to eachother in channels, send private messages to others users, send files, and create new channels.

Let's get started

@johnsonch
johnsonch / contact.php
Last active August 29, 2015 14:00
A simple PHP email setup
$top = "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html>";
$bottom = "<body></body></html>";
$blank = ' ';
$sep = "\r\n";
$subject = $_POST['subject'];
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$message = $_POST['message'];
$contact = $_POST['email'] .$blank .$_POST['phone'];
@johnsonch
johnsonch / fizzbuzz_refactor.rb
Created May 24, 2013 18:19
This gist is some not very good ruby code. Refactor it and make it better while keeping the tests pass.
class FizzBuzz
def self.evaluate(number)
if number % 5 == 0 && number % 3 == 0
return "fizzbuzz"
elsif number % 3 == 0
return "fizz"
elsif number % 5 == 0
return "buzz"
else
return number.to_s
#!/usr/bin/env ruby
# In order to make this script run stand alone it needs to run in the context of the gem set that has 'fog' installed.
# However to run as an included file in a spec file it will already need to be in that gemset
if $0 == __FILE__
require 'rvm'
File.open(File.join(File.dirname(__FILE__), '..', '.rvmrc')) do |f|
@rvmrc_gemset = f.read.match(/(ruby[^ ]+)/)[1]
@johnsonch
johnsonch / rvmissue.sh
Created February 1, 2013 17:48
rvmsudo issue
cd ~/
echo pwd
export rvmsudo_secure_path=1
echo "export ok"
rvmsudo ruby-1.9.3-p286@mygemset -e "require 'ghost'; Ghost.store = Ghost::Store::HostsFileStore.new; host = Ghost::Host.new('myvagrant.com', '33.33.33.27'); Ghost.store.add(host)"
echo "rvmsudo ok"
cd /home
echo "change directory"
echo pwd
@johnsonch
johnsonch / gist:4692398
Created February 1, 2013 16:32
Error warning from rvmsudo
Running:
$ rvmsudo ruby-1.9.3-p286@mygemset -e "require 'ghost'; Ghost.store = Ghost::Store::HostsFileStore.new; host = Ghost::Host.new('myvagrant.com', '33.33.33.27'); Ghost.store.add(host)"
Results in:
Warning: can not check `/etc/sudoers` for `secure_path`, falling back to call via `/usr/bin/env`, this breaks rules from `/etc/sudoers`. export rvmsudo_secure_path=1 to avoid the warning.Warning: can not check `/etc/sudoers` for `secure_path`, falling back to call via `/usr/bin/env`, this breaks rules from `/etc/sudoers`. export rvmsudo_secure_path=1 to avoid the warning