Skip to content

Instantly share code, notes, and snippets.

@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'];

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

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]
@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
@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
<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 / fizzbuzz.php
Created March 3, 2015 21:11
for class fizzbuzz example
<?php
function generate_output($value){
if (is_fizz($value) && !is_buzz($value)){
return "fizz";
}
if (is_buzz($value) && !is_fizz($value)){
return "buzz";
}
@johnsonch
johnsonch / car.php
Created March 26, 2015 04:40
Simple PHP class example for class
class Car{
public $make;
public $model;
public function getMake(){
return $this->make;
}
public function setMake($input_make){
$this->make = $input_make;
@johnsonch
johnsonch / myclass.php
Created March 30, 2015 16:23
PHP getter and setter example for class
<?php
class myClass{
private $propertyA
private $propertyB
public function getPropertyA(){
return $this->propertyA;
}
public function setPropertyA($value){
@johnsonch
johnsonch / gist:2f9f65f5b06aaa55cad4
Created April 15, 2015 23:10
match_all_class_example.php
<?php
$string = 'My lovely gloves are lost in the clover, Love.';
$result = preg_match_all('/(\w*lo\w*)/i', $string, $matches);
if ($result == true) {
print "Found $result matches<br />";
}
else {
print 'Didn\'t find a match<br />';
}
$match_results = $matches[0];