Skip to content

Instantly share code, notes, and snippets.

Avatar

Seth Livingston sethlivingston

  • Murphy, TX
View GitHub Profile
View gist:11384106
<script>
YUI_config = {
combine: true,
comboBase: '/combo?',
root: '/yui\/3.14.1\/',
skin: {
overrides: {
slider: ['sam-dark']
}
}
@sethlivingston
sethlivingston / app.coffee
Last active Aug 29, 2015
Understanding Y.App Transitions
View app.coffee
MyApp = Y.Base.create 'myApp', Y.App, [],
views:
signIn:
type: SignInView
requestPasswordReset:
type: RequestPasswordResetView
parent: 'signIn'
checkEmail:
type: CheckEmailView
View plug-unplug.js
node.unplug(Y.DD.Drag);
node.plug(Y.Plugin.Drag);
node.dd.plug(Y.Plugin.DDConstrained, {
constrain2node: constrainNode,
tickX: gridSize,
tickY: gridSize
});
node.dd.plug(Y.Plugin.DDWinScroll);
...
@sethlivingston
sethlivingston / request.http
Last active Aug 29, 2015
Returning a text file from ServiceStack
View request.http
GET /DocData/api/replication/db.json?DbName=test HTTP/1.1
Host: localhost
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Cookie: ss-id=hO2XaZXMotKtMOEOE4WF; ss-pid=9MwQlX6VDITl5UcGsLfH; DocStudySetId=7945916; AuthSession=
View gist:e3d568c401811cf95b92
Workflow.run = function (actions) {
var files = [];
var promise = Promise.resolve(files);
actions.forEach(function(action) {
promise = promise.then(function (outFiles) {
// Need to return a promise here to keep the chain going
return new Action(action, outFiles);
});
});
promise = promise.catch(function (error) {
View nav-panel-button.jsx
var classnames = require('classnames');
var {Link, History} = require('react-router');
var React = require('react');
var NavPanelButton = React.createClass({
mixins: [History],
click: function (e) {
e.preventDefault();
@sethlivingston
sethlivingston / react-redux-component.jsx
Last active Jan 29, 2016
Samples from an actual React/Redux application
View react-redux-component.jsx
import classNames from 'classnames';
import React from 'react';
const NavTab = ({ selected, icon, onClick, children }) => {
let tabClasses = classNames({
'nav-tab': true,
'selected': selected
});
let iconClasses = `fa fa-${icon} fa-lg fa-fw`;
View cards-p1-1.re
type suit =
| Diamonds | Clubs | Hearts | Spades;
type rank =
| Two | Three | Four | Five | Six | Seven | Eight | Nine | Ten;
type face =
| Jack | Queen | King | Ace;
View cards-p1-2.txt
Reason # type face = | Jack | Queen | King | Ace;
type face = Jack | Queen | King | Ace
Reason # let f1 = Queen;
let f1 : face = Queen
Reason # let f2 = Ace;
let f2 : face = Ace
Reason # f1 > f2;
You can’t perform that action at this time.