Skip to content

Instantly share code, notes, and snippets.

@johnsonch
johnsonch / contact_response.php
Created July 28, 2011 00:19
Simple PHP Contact form and response
<?PHP
$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'];
@johnsonch
johnsonch / fizzbuzz.rb
Created November 2, 2011 14:53
RubyQuiz 11/2/2011 - Fizzbuzz
class Game
def self.fizzbuzz
Array(1..100).map{|x| output(x) }
end
def self.output(statement)
puts is_fizz_buzz?(statement) || is_fizz?(statement) || is_buzz?(statement) || statement
end
def self.is_fizz_buzz?(statement)
@johnsonch
johnsonch / hack.sh
Created April 20, 2012 19:32 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@johnsonch
johnsonch / info.php
Created October 6, 2012 14:26
php info
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);
?>
@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
@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
#!/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 / 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
@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