Skip to content

Instantly share code, notes, and snippets.

@kryft
kryft / test2.jsx
Created March 3, 2015 17:06
C-m-f and C-m-b work
function foo() {
return (
<div>
<h1>Events</h1>
<table>
<thead>
<tr>
<th>{ /*Sign up link*/ }</th>
<th>{ /*Name */ }</th>
<th>Places available</th>
@kryft
kryft / test.jsx
Last active August 29, 2015 14:16
C-m-f and C-m-b don't work
function foo() {
return (
<div>
<h1>Events</h1>
<table>
<thead>
<tr>
<th>{/*Sign up link*/}</th>
<th>{/*Name */}</th>
<th>Places available</th>
@kryft
kryft / gist:b4e3984dc18fbe6b5fad
Created January 24, 2015 15:47
Two fn expressions with the same name
(sc/defschema NonNegInt
"Schema for a non-negative integer."
(sc/both
sc/Int
(sc/pred (fn is-positive [key] (>= key 0)))))
(sc/defschema PosInt
"Schema for a positive integer."
(sc/both
sc/Int
@kryft
kryft / switch.js
Last active August 29, 2015 14:07
web-mode 20140927.1330 indentation for switch statements in .js files
//this is how the code gets indented in web-mode 20140927.1330 from melpa
eventStore.dispatchToken = dispatcher.register(function(payload) {
switch(payload.action.type) {
case actionTypes.REQUEST_EVENT_SUCCESS:
doSomething();
break;
}
});
@kryft
kryft / gist:b354729c78d1eef5710b
Created August 2, 2014 08:52
Trouble indenting switch statements in .jsx files in web-mode
/** @jsx React.DOM */
//Indentation produced by web-mode
var Component = React.createClass({
render : function() {
var stuff = this.props.formElements.map(function(elem) {
switch(elem) {
case "textarea" :
return ( <textarea rows="4" /> );