Skip to content

Instantly share code, notes, and snippets.

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