This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<!-- converted from php http://www.geekpedia.com/tutorial213_Creating-a-UPS-Shipping-Calculator.html --> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<meta charset=utf-8 /> | |
<title>Unofficial UPS Shipping Calculator</title> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo su | |
apt-get update | |
apt-get install unzip apache2 php5-mysql libapache2-mod-php5 mysql-server phpmyadmin | |
# go through the wizards and set up the passwords, making sure to write them down / memorize! | |
a2enmod rewrite | |
nano /etc/apache2/sites-enabled/000-default | |
# change AllowOverride setting for /var/www from None to All, save then quit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function validate(name, email) { | |
var errors = []; | |
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; | |
if(name === '') { | |
errors.push('You forgot to enter your name'); | |
} | |
if(email === '' || !emailReg.test(email)) { | |
errors.push('Your e-mail address is invalid'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Author: Stephen Bussard | |
Twitter: @sbussard | |
*/ | |
var sin = Math.sin; | |
var cos = Math.cos; | |
var tan = Math.tan; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add this line at the end of the file | |
python ~/.psam.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// created for apple.com/contact | |
"{ | |
'language': 'en-us', | |
'charset': 'utf-8', | |
'author': 'Apple Inc.', | |
'omni_page': 'How to Contact Us', | |
'publish-date': 'May 12, 2013', | |
'sitemap': 'http://www.apple.com/sitemap', | |
'shortcut-icon': 'http://www.apple.com/favicon.ico', | |
'viewport': 'width=1024', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// requires jQuery obviously | |
$(function(){ | |
$('img').each(function(i, img){ | |
var $img = $(img); | |
var url = $img.attr('src'); | |
var w = $img.width(); | |
var h = $img.height(); | |
var canvas = $('<canvas data-image="'+i+'"></canvas>').attr({ width: w, height: h }); | |
$(img).replaceWith(canvas); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
box-sizing: border-box; | |
} | |
body { | |
font-family: sans-serif; | |
margin: 0; | |
padding: 0; | |
background-color: #f0f0f0; | |
} | |
#logo { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this to ~/.profile or ~/.bashrc or whatever | |
# ask for a confirmation before executing the following command | |
confirm() { | |
read -r -p "Are you sure? [y/N] " response | |
[[ $response =~ ^([yY][eE][sS]|[yY])$ ]] && $@ | |
} | |
export alias c=confirm |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.