Skip to content

Instantly share code, notes, and snippets.

@dodozhang21
dodozhang21 / gist:852146
Created March 3, 2011 01:32
deleteConfirmation - jQuery UI modal window init
// create the jQuery modal window and set autoOpen to false
$("#jQueryDeleteConfirmationModalWindow").dialog({
title: "Delete Confirmation",
autoOpen: false, // set this to false so we can manually open it
dialogClass: "jQueryDeleteConfirmationModalWindow",
closeOnEscape: false,
draggable: false,
width: 460,
height: 260,
modal: true,
@dodozhang21
dodozhang21 / gist:852156
Created March 3, 2011 01:38
deleteConfirmation - delete action links bind
$('a.deleteConfirmation').click(function() {
var name = $(this).parent().parent().children('td.name').html(); // a.delete -> td -> tr -> td.name
name = jQuery.trim(name);
$("#jQueryDeleteConfirmationModalWindow").html('Are you sure you wish to delete ' + name + '?');
$("#jQueryDeleteConfirmationModalWindow").dialog('open');
return false;
});
@dodozhang21
dodozhang21 / index.slim
Created July 4, 2013 23:42
A CodePen by dodozhang21. Responsive search bar - A great technique of styling a search bar.
form.search
input.searchTerm placeholder="Enter your search term ..."
input.searchButton type="submit"
span.searchIcon
/**
* Helper function for passing arrays of promises to $.when
*/
jQuery.whenArray = function ( array ) {
return jQuery.when.apply( this, array );
};
/**
* Accepts a single image src or an array of image srcs.
@dodozhang21
dodozhang21 / SassMeister-input-HTML.html
Created February 3, 2015 02:11
Generated by SassMeister.com.
<header id="siteHeader" class="defaultHead">
Header
</header>
<div id="siteContainer">
<div id="siteContent" class="twoColumn">
<section id="upperMainColumn" role="main" class="contentWell">
UpperMain
<p> Llama ipsum dolor sit amet consectetur alpaca elit, nam mattis risus sit amet tellus, posuere vel pronking diam adipiscing nullam. Semper bibendum nisi in humming llambada vivamus vel purus eu ipsum, kush placerat curabitur ullamcorper metus vel ipsum tempor feugiat. Eget quis mi vivamus at turpis lama glama a lobortis, nunc nunc sodales accumsan orci a tristique ut, eu interdum odio in hac habitasse platea dictumst. nam scelerisque here a llama yearling there a llama humming, massa sit amet auctor velit and another little llama morbi quis, yearling diam ut nisi urna fringilla rhoncus malesuada at.
@dodozhang21
dodozhang21 / SassMeister-input-HTML.html
Last active August 29, 2015 14:14
Generated by SassMeister.com.
<header id="siteHeader" class="defaultHead">
Header
</header>
<div id="siteContainer">
<div id="siteContent">
<section id="upperMainColumn" role="main" class="contentWell">
UpperMain
var request = require('request');
getAdminUserStatus('user2', 'pass2')
.then(bindTestAcount)
.then(checkUser);
function getAdminUserStatus(name, pass) {
return new Promise(function (resolve, reject) {
request("http://google.com", function (error, body) {
{
"alias-lookup": [
{
"uuid": "12341",
"id": "abcd1",
"entity_type": "node",
"bundle": "story",
"response_code": 200,
"alias": "/canonical/alias1"
},
# Copied and modified from https://github.com/amio/docker-node-chrome
FROM node:6.10.3
LABEL name="node-chrome"
# Install Chrome
RUN echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list
const fs = require('fs');
const path = require('path');
const iconDirectory = path.join(__dirname, '/shared/partials/icons/');
const singleFile = path.join(__dirname, '/shared/partials/icons/36px/pinterest-gallery-overlay.hbs');
function walkSync(dir, filelist) {
const files = fs.readdirSync(dir);
filelist = filelist || [];
files.forEach(function (file) {
if (fs.statSync(dir + file).isDirectory()) {