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
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes" /> | |
<xsl:template match="/faq_page"> | |
<xsl:if test="count(//question) > 5"> | |
<xsl:for-each select="category"> |
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
public class AllowCrossSiteJson : ActionFilterAttribute | |
{ | |
public override void OnActionExecuting(ActionExecutingContext filterContext) | |
{ | |
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache); | |
HttpContext.Current.Response.Cache.SetNoStore(); | |
var headers = Enumerable.ToList(HttpContext.Current.Request.Headers.AllKeys); | |
headers.Add("X-HTTP-Method-Override"); |
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
#!/usr/bin/env node | |
var program = require('commander'); | |
var email = require("mailer"); | |
program | |
.version('0.0.1') | |
.option('-s, --subject <text>', 'subject line of email') | |
.option('-b, --body <text>', 'body area of email') | |
.option('-r, --recipient <email>', "recipient's email address") |
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
// Based on https://github.com/jaubourg/ajaxHooks/blob/master/src/ajax/xdr.js | |
(function( jQuery ) { | |
if ( window.XDomainRequest && !jQuery.support.cors ) { | |
jQuery.ajaxTransport(function( s ) { | |
if ( s.crossDomain && s.async ) { | |
if ( s.timeout ) { | |
s.xdrTimeout = s.timeout; | |
delete s.timeout; |
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
#!/bin/sh | |
GIT_WORK_TREE=/var/www/www.example.org git checkout -f |
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
require.config({ | |
baseUrl: '/backbone-tests/', | |
paths: { | |
'jquery' : '/app/libs/jquery', | |
'underscore' : '/app/libs/underscore', | |
'backbone' : '/app/libs/backbone', | |
'mocha' : 'libs/mocha', | |
'chai' : 'libs/chai', | |
'chai-jquery' : 'libs/chai-jquery', | |
'models' : '/app/models' |
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
$.fn.dataTableExt.oApi.fnFakeRowspan = function (oSettings) { | |
_.each(oSettings.aoData, function(oData) { | |
var cellsToRemove = []; | |
for (var iColumn = 0; iColumn < oData.nTr.childNodes.length; iColumn++) { | |
var cell = oData.nTr.childNodes[iColumn]; | |
var rowspan = $(cell).data('rowspan'); | |
var hide = $(cell).data('hide'); | |
if (hide) { | |
cellsToRemove.push(cell); |
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
class view extends Backbone.View | |
initialize: => | |
@template = _.template($('#mytemplate').html()) | |
render: => | |
@$el.html @template( | |
model: @model.toJSON() | |
) |
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
define(function(require) { | |
var Backbone = require('backbone'); | |
var _ = require('underscore'); | |
var models = require('./models'); | |
var collections = {}; | |
collections.Posts = Backbone.Collection.extend({ | |
model: models.Post, |
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
import {Component, bootstrap, FORM_DIRECTIVES, CORE_DIRECTIVES} from 'angular2/angular2'; | |
import {HeroList} from './hero-list.component'; | |
import {Hero} from './hero'; | |
@Component({ | |
selector: 'my-app', | |
directives: [FORM_DIRECTIVES, CORE_DIRECTIVES, HeroList], | |
template:` | |
<h1>{{title}}</h1> |
OlderNewer