This file contains hidden or 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
"use strict"; | |
/** | |
* Hypertext Transfer Protocol (HTTP) response status codes. | |
* @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes} | |
*/ | |
enum HttpStatusCode { | |
/** | |
* The server has received the request headers and the client should proceed to send the request body |
This file contains hidden or 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
const { google } = require('googleapis'); | |
const moment = require('moment'); | |
// Assuming we have authed against Google's API and we have permission... | |
const getRecentEmails = (auth, from, daysAgo = 14) => { | |
const gmail = google.gmail({ version: 'v1', auth }); | |
const date = moment().subtract(daysAgo, 'days').format('YYYY/MM/DD'); | |
gmail.users.messages.list({ userId: 'me', q: `label:inbox from:${from} newer:${date}` }, handleListResponse(gmail)); | |
}; |
This file contains hidden or 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
// components/search/factory.js | |
// Grab singleton instance of DI container | |
import { container } from './depdendencies'; | |
import actionFactory from '../../actions'; | |
export const createActions = () => { | |
const http = container.instance('HTTP'); | |
return actionFactory(http); |
This file contains hidden or 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
<html> | |
<head> | |
<title>Some page</title> | |
<script src="path/to/angular.js"></script> | |
<script src="path/to/scripts.js"></script> | |
<script type="text/javascript"> | |
// Setting a constant/value in Angualr allows it to be accessed via dependency injection | |
angualr.module('someApp').value('apiUrlBase', '<?php echo getenv('API_URL_BASE'); ?>'); | |
</script> | |
</head> |
This file contains hidden or 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(['backbone'], function (Backbone) { | |
return { | |
init: function () { | |
Backbone.View.prototype.close = function () { | |
this.remove(); | |
this.unbind(); | |
if (typeof this.onClose === 'function') { | |
this.onClose(); | |
} |
This file contains hidden or 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 () { | |
'use strict'; | |
window.Rock = window.Rock || {}; | |
Rock.settings = (function () { | |
var _settings = {}, | |
exports = { | |
initialize: function (options) { | |
if (typeof options === 'object') { | |
_settings = options; | |
} |
This file contains hidden or 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
// | |
// THIS WORK IS LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION-NONCOMMERCIAL- | |
// SHAREALIKE 3.0 UNPORTED LICENSE: | |
// http://creativecommons.org/licenses/by-nc-sa/3.0/ | |
// | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.ComponentModel.Composition; | |
using System.Linq; |
This file contains hidden or 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
<asp:HiddenField ID="hfCardType" runat="server"/> | |
<asp:Panel ID="View1" runat="server"> | |
<!-- your card selection script goes here... --> | |
<asp:LinkButton ID="fooButton" runat="server" Text="Foo" OnClick="fooButton_Click"/> | |
</asp:Panel> | |
<asp:Panel ID="View2" runat="server"> | |
<asp:Literal ID="lCardType" runat="server"/> | |
</asp:Panel> |
This file contains hidden or 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
<h3 class="header-text" >Confirm your Contribution: </h3> | |
<p><b><asp:Literal ID="lName" runat="server" /></b>, thank you for your generosity! You are about to give a gift totalling <b><asp:Literal ID="lTotal" runat="server"/></b> to the following funds:</p> | |
<asp:Repeater ID="rptGifts" runat="server"> | |
<HeaderTemplate> | |
<ul> | |
</HeaderTemplate> | |
<ItemTemplate> | |
<li><%# Eval("Amount").ToString("C") %> to the <%# Eval("Fund") %>.</li> | |
</ItemTemplate> | |
<FooterTemplate> |
This file contains hidden or 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
TemplateManager = | |
partials: [] # e.g. - 'loginForm' | |
templates: {} | |
get: (id, callback) -> | |
# If the template is already in the cache, just return it. | |
if @templates[id] then return callback @templates[id] | |
# Otherwise, use Traffic Cop to load up the template. | |
url = "/templates/#{id}.html" | |
promise = $.trafficCop url |
NewerOlder