Skip to content

Instantly share code, notes, and snippets.

View jakebellacera's full-sized avatar

Jake Bellacera jakebellacera

View GitHub Profile
@jakebellacera
jakebellacera / nginx-apache-reverse-proxy-wordpress-mu-vhost.conf
Created September 21, 2010 23:39
Useful nginx virtual host configuration for reverse proxy (proxy_pass) with Apache
# useful nginx configuration for reverse proxy with Apache
# edit lines 8, 11, and 30
# taken from: http://syslog.tv/2010/01/11/debian-apache-2-nginx-wordpress-mu/
# edits by jakebellacera (http://github.com/jakebellacera && http://jakebellacera.com)
server {
listen 80;
server_name domain.com *.domain.com; # edit this to your domain
@jakebellacera
jakebellacera / dateToUnix.php
Created October 19, 2010 19:31
Quick little function to convert date strings to unix timestamps
// The Function
function dateToUnix($time) {
return date('U', strtotime($time));
}
// Example:
// We need to convert a simple string to a UNIX timestamp.
$sampleDate = '9/15/2010 05:30';
@jakebellacera
jakebellacera / ICS.php
Last active April 19, 2024 09:06
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
@jakebellacera
jakebellacera / columns_template.less
Created November 18, 2010 20:32
Columns template for LESS CSS
/************************
Columns
=======
General template for creating columns.
Usage
-----
To use, just set a parent div with three different classes:
* .columns -- this defines the column class
<?php
// RFLX <img> resize
// server-side image resizing
function rflx_img_resize($src, $width, $height, $mu = true, $zoom = true) {
if ($zoom) {
if ($zoom == false) {
$z = 0;
} else {
$z = 1;
@jakebellacera
jakebellacera / proper-forms.html
Created January 19, 2011 00:24
A nicer-looking form.
<!-- Begin 'ze form -->
<h2>Contact Form</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<form>
<div>
<fieldset>
<legend>Name &amp; Stuff</legend>
@jakebellacera
jakebellacera / ajax-send.js
Created February 22, 2011 19:03
JQuery validate form that submits via AJAX
/*
ajax-send.js - copyright Jake Bellacera (http://jakebellacera.com)
This script uses JQuery & JQuery Validate (https://github.com/jzaefferer/jquery-validation)
For this example, we will have a form named '#ajaxform', you can of course change this to whatever you'd like.
*/
$(function(){
$('#submitbutton').click(function() {
@jakebellacera
jakebellacera / swfobject-gc.html
Created April 1, 2011 18:00
swfobject embedding for splash page/etc
<!-- Paste these in the head if you're using a splash page -->
<script src="/engine/js/jquery/jquery-1.4.2.js" type="text/javascript"></script>
<script type="text/javascript" src="/engine/js/swfobject/swfobject-2.2.js"></script>
<!-- The actual video -->
<div id="video_player">Loading...</div>
<script type="text/javascript">
{literal}
var vars = {};
var params = {};
@jakebellacera
jakebellacera / shell-buttons.scss
Created April 26, 2011 20:45
Custom CSS button framework for SASS
/**
* Shell Buttons
*/
@mixin shellBtn-colors($color) {
$color1: lighten($color, 15%);
$color2: lighten($color, 5%);
$color3: lighten($color, 10%);
$color4: $color;
$color5: darken($color, 10%);
border-color: $color5;
@jakebellacera
jakebellacera / mail.js
Created April 29, 2011 19:53
A super advanced JS emailer. Uses the JQuery Validation plugin.
/**
* Mail.js 1.1
* ===========
* A simple AJAX emailer
*/
$(function(){
$('#mailform').validate({
// Set rules for special fields (email/phone)
rules: {