Skip to content

Instantly share code, notes, and snippets.

View joeydi's full-sized avatar

Joe di Stefano joeydi

View GitHub Profile
@Tommy-b
Tommy-b / GRAVITY FORMS WITH SWUP - BARBA PAGE TRANSITIONS
Last active April 23, 2024 14:21
This allows your gravity forms to load via ajax to ensure they work correctly with page transitions that have no window/document.onload
This allows your gravity forms to load via ajax to ensure they work correctly with page transitions that have no window/document.onload
@vectorsize
vectorsize / linearScale.js
Last active December 20, 2022 14:30
Quick linear scale inspired by d3.js scales, based on the processing.org map() function.takes in an object with a domain array and a rage array, gives you back a function that receives a value and returns the scaled value.
// based on https://github.com/processing/processing/blob/a6e0e227a948e7e2dc042c04504d6f5b8cf0c1a6/core/src/processing/core/PApplet.java#L5093
var scale = function(opts){
var istart = opts.domain[0],
istop = opts.domain[1],
ostart = opts.range[0],
ostop = opts.range[1];
return function scale(value) {
return ostart + (ostop - ostart) * ((value - istart) / (istop - istart));
@paulkaplan
paulkaplan / gist:5770247
Last active October 12, 2021 01:43
Orbit Controls with momentum and damping for THREE.js
/**
* @author qiao / https://github.com/qiao
* @author mrdoob / http://mrdoob.com
* @author alteredq / http://alteredqualia.com/
* @author WestLangley / http://github.com/WestLangley
*
* customized for momentum (zoom and phi/delta) by paulkaplan
*/
THREE.OrbitControls = function ( object, domElement ) {
@wpscholar
wpscholar / functions.php
Last active March 1, 2021 13:26
Enqueueing IE conditional stylesheets in WordPress the right way
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
/**
* Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE.
* IE10 and up does not support conditional comments in standards mode.
*
* @uses wp_style_add_data() WordPress function to add the conditional data.
* @link https://developer.wordpress.org/reference/functions/wp_style_add_data/
@awshout
awshout / foundation4-topbar-menu.php
Last active August 19, 2023 02:44
WordPress Menu & Walker for ZURB's Foundation 4 Top Bar
<?php
add_theme_support('menus');
/**
* Register Menus
* http://codex.wordpress.org/Function_Reference/register_nav_menus#Examples
*/
register_nav_menus(array(
'top-bar-l' => 'Left Top Bar', // registers the menu in the WordPress admin menu editor
'top-bar-r' => 'Right Top Bar'
@kasparsd
kasparsd / wordpress-plugin-svn-to-git.md
Last active April 17, 2024 12:35
Using Git with Subversion Mirroring for WordPress Plugin Development
@Ssiskind
Ssiskind / HubSpot Landing Page Dummy Form Code
Created August 15, 2012 23:13
Use this sample code to generate a dummy form in your HubSpot landing page template
<div class="form-wrapper">
<div class="form-wrapper-inner">
<div id="hubspot_form_widget_wrapper">
{% form "main_form" editing={group="page_actions", order=30} %}
</div>
<div id="hubspot_dummy_form" style="display: none">
<form class="hs-form stacked">
<h3 class="form-title">Fill Out Our Form</h3>
<div class="field">
<label>First Name</label>
import sys
import csv
import httplib, urllib, base64
def main():
# set the name of your repository, username and password
username = "test"
password = "test"
repo = "test"
@esfand
esfand / Deploy
Created April 5, 2012 15:11
WebFaction Deploy Apps using Git
I've tried now for several hours understanding how to use Git with webfaction.
And even with the documentation I cannot get it to work.
I have a Django app at: webapps/django_app/project_name/
I have a Git repo at: webapps/git_app/repos/my_repo.git
I assume the following workflow:
Make som local changes
@cballou
cballou / youtube-vimeo-embed-urls.php
Created March 27, 2012 15:52
PHP Function to Convert Youtube and Vimeo URLs to Lightbox-Ready Equivalents
<?php
/**
* Given a string containing any combination of YouTube and Vimeo video URLs in
* a variety of formats (iframe, shortened, etc), each separated by a line break,
* parse the video string and determine it's valid embeddable URL for usage in
* popular JavaScript lightbox plugins.
*
* In addition, this handler grabs both the maximize size and thumbnail versions
* of video images for your general consumption. In the case of Vimeo, you must
* have the ability to make remote calls using file_get_contents(), which may be