Skip to content

Instantly share code, notes, and snippets.

Jake Bellacera jakebellacera

Block or report user

Report or block jakebellacera

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jakebellacera
jakebellacera / nginx-apache-reverse-proxy-wordpress-mu-vhost.conf
Created Sep 21, 2010
Useful nginx virtual host configuration for reverse proxy (proxy_pass) with Apache
View nginx-apache-reverse-proxy-wordpress-mu-vhost.conf
# 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 Oct 19, 2010
Quick little function to convert date strings to unix timestamps
View dateToUnix.php
// 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 Sep 17, 2019
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
View ICS.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 Nov 18, 2010
Columns template for LESS CSS
View columns_template.less
/************************
Columns
=======
General template for creating columns.
Usage
-----
To use, just set a parent div with three different classes:
* .columns -- this defines the column class
View timthumb.php
<?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;
View proper-forms.html
<!-- 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 Feb 22, 2011
JQuery validate form that submits via AJAX
View ajax-send.js
/*
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 Apr 1, 2011
swfobject embedding for splash page/etc
View swfobject-gc.html
<!-- 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 Apr 26, 2011
Custom CSS button framework for SASS
View shell-buttons.scss
/**
* 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 Apr 29, 2011
A super advanced JS emailer. Uses the JQuery Validation plugin.
View mail.js
/**
* Mail.js 1.1
* ===========
* A simple AJAX emailer
*/
$(function(){
$('#mailform').validate({
// Set rules for special fields (email/phone)
rules: {
You can’t perform that action at this time.