Skip to content

Instantly share code, notes, and snippets.

View davidpanzarella's full-sized avatar

David Panzarella davidpanzarella

View GitHub Profile
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active July 14, 2024 19:27
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@lancejpollard
lancejpollard / paginator.html
Created June 26, 2011 18:11
Semantic Pagination HTML5
<nav class='paginator' role='toolbar'>
<ul class='goto-pages'>
<li class='goto-search'>
<a href="#search" class="search-pages" title="Toggle Advanced Search">&#8981;</a>
</li>
<li class='goto-page'>
<a href="/admin/users?page=1" aria-disabled="true" class="first-page disabled" data-page="1" rel="first" title="Go to the first page">&#8676;</a>
</li>
<li class='goto-page'>
<a href="/admin/users?page=1" aria-disabled="true" class="prev-page disabled" data-page="1" rel="prev" title="Go to page 1">&#8672;</a>
@tsabat
tsabat / zsh.md
Last active July 7, 2024 16:56
Getting oh-my-zsh to work in Ubuntu
@drewjoh
drewjoh / custom.js
Created January 27, 2012 13:55
Dynamic (AJAX) loaded Bootstrap Modal (Bootstrap 2.1)
$(document).ready(function() {
// Support for AJAX loaded modal window.
// Focuses on first input textbox after it loads the window.
$('[data-toggle="modal"]').click(function(e) {
e.preventDefault();
var url = $(this).attr('href');
if (url.indexOf('#') == 0) {
$(url).modal('open');
} else {
<cfscript>
/**
*
* This file is part of MuraLocations TM
* (c) Stephen J. Withington, Jr. | www.stephenwithington.com
*
* CAREFULLY READ THE ENCLOSED LICENSE AGREEMENT (plugin/license.htm). BY USING THIS SOFTWARE,
* YOU ARE CONSENTING TO BE BOUND BY AND ARE BECOMING A PARTY TO THIS AGREEMENT. IF YOU DO NOT
* AGREE TO ALL OF THE TERMS OF THIS AGREEMENT, THEN DO NOT USE THIS SOFTWARE, AND, IF APPLICABLE,
* RETURN THIS PRODUCT TO THE PLACE OF PURCHASE FOR A FULL REFUND.
@smeranda
smeranda / facebook_like-box_responsive.css
Created May 1, 2012 20:37
Flexible width layout for Facebook Like Box/Activity Stream to use in Responsive Designs
/*
Make the Facebook Like box responsive (fluid width)
https://developers.facebook.com/docs/reference/plugins/like-box/
*/
/* This element holds injected scripts inside iframes that in some cases may stretch layouts. So, we're just hiding it. */
#fb-root {
display: none;
}
@davidwaterston
davidwaterston / Geolocating IP Addresses for free using geoPlugin.net and ColdFusion
Created July 8, 2012 00:05
A ColdFusion function to grab geolocation details for an IP address using the free geoPlugin.net service.
<cfcomponent name="geoPlugin" output="no">
<cffunction name="ipLocation" access="remote" returntype="struct" displayname="ipLocation" output="no">
<!---
This function takes an IP address and passes it to http://www.geoplugin.net, a free GeoLocation service that
returns info about where that IP address is located i.e. city, country, etc. The returned data from geoPlugin
is cleaned up and returned as a ColdFusion structure.
Where the IP address is not passed in then geoPlugin.net will use the IP of the calling page. The IP used is
always returned in the 'geoplugin.request' variable.
@stevewithington
stevewithington / dsp_custom_search.cfm
Last active March 19, 2021 16:25
Mura CMS: Custom Search Example
<cfoutput>
<div>
<form action="#$.content('url')#?keywords=#$.event('keywords')#">
<dl>
<dt>Keywords</dt>
<dd><input type="text" name="keywords" value="#HTMLEditFormat($.event('keywords'))#" /></dd>
<dd><input type="submit" value="Search" /></dd>
</dl>
@joebrislin
joebrislin / application.cfc
Created October 17, 2012 16:26
Slatwall: Updated Delivery Confirmation utilizing orderFulfillment entity
if ( not StructKeyExists(request.context, '$') ) {
request.context.$ = application.serviceFactory.getBean('muraScope');
if ( StructKeyExists(session, 'siteid') ) {
request.context.$.init(session.siteid);
} else {
request.context.$.init('default');
};
};
@stevewithington
stevewithington / muraCategoryIteratorExamples.cfm
Created November 29, 2012 18:13
Mura CMS: Category Iterator Examples
<cfscript>
// Category Iterator of Children of the Current Content Node
itKidsCats = $.content().getKidsCategoryIterator();
// Category Iterator of the CURRENT Content Node
itCats = $.content().getCategoriesIterator();
</cfscript>
<cfoutput>
<!--- Children of the Current Content Node --->
<h4>Kids Categories</h4>
<cfif itKidsCats.hasNext()>