Skip to content

Instantly share code, notes, and snippets.

@natejones
natejones / registration-success
Last active February 11, 2024 06:28
Registration Success message
<!-- formstack submit redirect to same page with #success on the end -->
<!-- This goes at the top of the content -->
<div class="alert-box success radius" data-alert="" id="success" style="display: none;">Success! Thank you for registering for Open House! <a class="close" href="#">&#215;</a></div>
<!-- this goes anywhere -->
<!--#protect
<script type="text/javascript">
if(window.location.hash) {
@natejones
natejones / zendeskTab
Created November 14, 2013 19:52
Zendesk tab Ask Us Right Blue Helpcenter, Chat, Ticket
<!-- ZENDESK WIDGET -->
<script type="text/javascript" src="//assets.zendesk.com/external/zenbox/v2.6/zenbox.js"></script>
<style type="text/css" media="screen, projection">
@import url(//assets.zendesk.com/external/zenbox/v2.6/zenbox.css);
</style>
<script type="text/javascript">
if (typeof(Zenbox) !== "undefined") {
Zenbox.init({
dropboxID: "20265836",
url: "https://columbiachi.zendesk.com",
@blackfalcon
blackfalcon / 1_example_mixin.scss
Created May 18, 2012 05:32
That BOOM moment where we discovered the real power of @extend
// We all know how to use mixins, right?
@mixin kung {
background: green;
color: yellow;
}
@mixin foo {
background: orange;
color: red;
@vidoss
vidoss / gist:2178987
Created March 24, 2012 06:20
Using underscore.js while scripting mongodb shell.
MongoDB provides a Javascript shell. But Javascript is no fun without underscore.js
Turned out its straight forward to use underscore.js while scripting mongodb.
Here are the steps.
1) Use underscore to write your db script file (say my_commands.js)
E.g: _.each(db.dbname.find().toArray(), function(itm) { ... })
@robtarr
robtarr / inputs.html
Created February 2, 2012 02:27
Number Input Tests
<!doctype html>
<html>
<head>
<title>Number Test</title>
<style>
tr {
background: #ddd;
}
tr:nth-child(odd) {
@adamphillips
adamphillips / Javascript dateDiff function to calculate difference in terms of days, months and years
Created October 6, 2010 00:17
A quick javascript dateDiff function that returns results in terms of days, months and years taking into account variable month lengths and leap years
/*
* Function to calculate the absolute difference in days, months and years between 2 days taking into account variable month lengths and leap years
* It ignores any time component (ie hours, minutes and seconds)
*
*/
function dateDiff(dt1, dt2)
{
/*
* setup 'empty' return object
*/