This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var fontFilenames = ['c.eot', 'ci.eot', 'c.svg', 'ci.svg', 'c.ttf', 'ci.ttf', 'c.woff', 'ci.woff']; | |
grunt.registerTask('fontPrep', 'Move Celeste fonts so that they are not handled by imageEmbed.', function(){ | |
// create a temp folder | |
fs.mkdirSync('css/fonts/tmp'); | |
fontFilenames.forEach(function(name){ | |
// move the Celeste fonts t othe temp folder | |
fs.renameSync('css/fonts/'+name, 'css/fonts/tmp/'+name); | |
// create dummy files that are large enough (>32k) to cause imageEmbed to skip them | |
fs.writeFileSync('css/fonts/'+name, (new Array(35000)).join(' ')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var httpProxy = require('http-proxy'); | |
// use environment variables if present. | |
var httpPort = process.env.PORT || 8000; | |
var httpsPort = process.env.HTTPS_PORT || 443; | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//FormStrategy.js | |
var fs = require("fs"), | |
forms = require("forms"), | |
connect = require('connect'), | |
url = require('url'), | |
jsSHA = require('./jsSHA'), | |
haml = require('hamljs'), // For a higher quality implementation you may want to look at [visionmedia]'s [Jade](http://jade-lang.com) template engine, | |
mailer = require('mailer'), | |
// our own libs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// also available at http://jsfiddle.net/dennishall/UydZn/ | |
var previousIndentation = ''; | |
var indent = " "; | |
/** | |
* Standard setup for a method | |
* | |
* @param Function callback The content of the script | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// replace "projectName" with your actual project name | |
package com.projectName.filters; | |
import javax.servlet.Filter; | |
import javax.servlet.FilterChain; | |
import javax.servlet.FilterConfig; | |
import javax.servlet.ServletRequest; | |
import javax.servlet.ServletResponse; | |
import java.io.IOException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){var a=location,b=/wcmmode=disabled[&]?/,c=a.search,d=c.replace(b,""),e="wcmmode=disabled",f=a.href.replace("/cf#","").replace("?","?"+e);a.href=b.test(a.href)?location.protocol+"//"+location.host+"/cf#"+location.pathname+(d.length?"?"+d:d)+location.hash:b.test(f)?f:f+"?"+e})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('ul.models li.model').each(function(i, node) { | |
var li = $(node); | |
// <li data-excludes="88995, 90000-99999"> | |
var includes = li.attr('data-includes').replace(' ', '').split(','); | |
var excludes = li.attr('data-excludes').replace(' ', '').split(','); | |
if(!includes.length){ | |
includes = [[0, 99999]]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function columnize(ul){ | |
var offsetTop = YAHOO.util.Dom.getRegion(ul).top; | |
var listItems = ul.getElementsByTagName('li'); | |
for(var i=0,l=listItems.length;i<l;i++){ | |
var region = YAHOO.util.Dom.getRegion(listItems[i]); | |
if(region.bottom - offsetTop > 200){ | |
var clone = ul.cloneNode(true); | |
// remove all list items that follow this one from the current list. (will be covered by the clone) | |
for(var j=l-1; j>=i; j--){ | |
ul.removeChild( ul.lastChild ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// stream media | |
// urls to consider: | |
// http://html5doctor.com/video-canvas-magic/ | |
// http://stackoverflow.com/questions/1106955/php-and-ffmpeg-performing-intelligent-video-conversion | |
// http://stackoverflow.com/questions/6954845/how-to-create-a-webm-video-file | |
// http://johndyer.name/ffmpeg-settings-for-html5-codecs-h264mp4-theoraogg-vp8webm/ | |
// http://blog.pcode.nl/2010/10/17/encoding-webm-using-ffmpeg/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _open = window.open; | |
window.open = function(a,b,c,d,e,f){ | |
var popupHandle = _open(a,b,c,d,e,f); | |
try { | |
popupHandle.isPopup = true; | |
}catch(e){ | |
//for pdf pop-ups | |
} | |
return popupHandle; | |
}; |
OlderNewer