Skip to content

Instantly share code, notes, and snippets.

View willwright82's full-sized avatar
👾
parsleybox.com

Will Wright willwright82

👾
parsleybox.com
View GitHub Profile
@willwright82
willwright82 / contact-form-handler.php
Created June 17, 2014 11:05
Contact Form PHP handler
<?php
$errors = '';
$myemail = '[email protected]';//<-----Put Your email address here.
if(empty($_POST['name']) ||
empty($_POST['email']) ||
empty($_POST['message']))
{
$errors .= "\n Error: all fields are required";
}
@willwright82
willwright82 / brace-form.html
Last active August 29, 2015 14:02
Formspree Form
<form action="//formspree.io/[email protected]">
<input type="text" name="name">
<input type="email" name="_replyto">
<textarea name="body">
<input type="submit" value="Send">
<input type="hidden" name="_next" value="//site.io/thanks.html" />
</form>
@willwright82
willwright82 / JQueryFramework.js
Last active August 29, 2015 14:03
JQuery Base FrameWork
$(document).ready(function() {
$('thingToTouch').event(function() {
$('thingToAffect').effect();
});
});
@willwright82
willwright82 / MultiStepForm
Created July 3, 2014 12:18
Multi Step Form
<form action="http://www.aweber.com/scripts/addlead.pl">
<div id="form_part1">
Name: <input name="name">
Email: <input name="from">
<button
onclick="openForm_part('form_part', 2)"
>Next »</button>
</div>
<div id="form_part2">
Phone: <input name="phone">
@willwright82
willwright82 / PHP301Redirect
Created July 3, 2014 13:44
PHP 301 Redirect
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.new-url.com" );
?>
@willwright82
willwright82 / ASP301Redirect
Created July 3, 2014 13:45
ASP 301 Redirect
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www.new-url.com/"
%>
@willwright82
willwright82 / ASPnet301Redirect
Created July 3, 2014 13:46
ASP.net 301 Redirect
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.new-url.com");
}
</script>
@willwright82
willwright82 / iFrameCSS-Jquery
Last active August 29, 2015 14:03
Insert CSS into iFrame through Jquery
var $head = $("#eFormIFrame").contents().find("head");
$head.append($("<link/>",
{ rel: "stylesheet", href: "url", type: "text/css" }
));
@willwright82
willwright82 / iFrameCSS-Timer-Jquery
Last active August 29, 2015 14:03
iFrame CSS with timer — requires Jquery
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
var frameListener;
$(window).load(function () {
frameListener = setInterval("frameLoaded()", 50);
});
function frameLoaded() {
var frame = $('iframe').get(0);
if (frame != null) {
@willwright82
willwright82 / SublimeText-Shortcuts
Last active August 29, 2015 14:03
Sublime Text Shortcuts
Basic
F11 Full Screen
shift + F11 Distraction Free Mode
ctrl + shift + p Command Palette
ctrl + ` Show Console
ctrl + k + b Show/Hide Sidebar
ctrl + / Comment
ctrl + shift + / Block Comment
ctrl + k + u Uppercase