Skip to content

Instantly share code, notes, and snippets.

View chriscorwin's full-sized avatar

Chris Corwin chriscorwin

View GitHub Profile
import React from 'react';
import CheckboxButtonGroup from '~components/forms/checkbox-button-group';
import CheckboxButtonGroupButton from '~components/forms/checkbox-button-group/checkbox-button-group-button';
const Example = React.createClass({
displayName: 'CheckboxButtonGroupExample',
render () {
return (
<CheckboxButtonGroup label="Scheduled Day(s)" name="scheduledDays">
renderChildren (parentId) {
const children = React.Children.toArray(this.props.children);
let result = null;
result = children.map((child, index) => React.cloneElement(child, {
name: this.props.name,
index,
errorId: `error-${parentId}`,
inputRef: (el) => this.inputElements.push(el),
onClick: this.handleClick,
@chriscorwin
chriscorwin / font_face.sublime-settings
Created March 23, 2017 15:23 — forked from rex/font_face.sublime-settings
Sublime Text 'font_face' configuration values
{
// "font_face": "Anonymous Pro",
// "font_face": "Anonymous Pro Bold",
// "font_face": "Anonymous Pro Minus",
// "font_face": "Anonymous Pro Minus Bold",
// "font_face": "Andale Mono",
// "font_face": "AverageMono",
// "font_face": "AverageMono Bold",
// "font_face": "Consola Mono",
// "font_face": "Consola Mono Bold",
ccorwin at ccorwin-ltm in ~/Library/Mobile Documents/com~apple~CloudDocs/Workspaces/expression-builder-react on sync-lightning-styles-with-fuelux-version
$ new sync-lightning-styles-with-fuelux-version--2
Configuring remote(s), if any...
####################################################################################
Creating new branch: `sync-lightning-styles-with-fuelux-version--2`
####################################################################################
#sSQL = ('
LOCK TABLE '+#cattable+' WRITE;
-- 1
SELECT @myLeft := lft, @myRight := rgt, @myWidth := rgt - lft + 1 FROM '+#cattable+' WHERE id = '+#id2+';
-- 2
UPDATE '+#cattable+' SET rgt = (rgt*-1), lft = (lft*-1) WHERE lft BETWEEN @myLeft AND @myRight;
-- 3
UPDATE '+#cattable+' SET rgt = rgt - @myWidth WHERE rgt > @myRight;
UPDATE '+#cattable+' SET lft = lft - @myWidth WHERE lft > @myRight;
-- 4a
local('sSQL' = (
'
SELECT node.id, node.name, (COUNT(parent.id) - (sub_tree.depth + 1)) AS depth, node.lft, node.rgt
FROM '+#cattable+' AS node,
'+#cattable+' AS parent,
'+#cattable+' AS sub_parent,
(
SELECT node.name, (COUNT(parent.id) - 1) AS depth
FROM '+#cattable+' AS node,
'+#cattable+' AS parent
#!/usr/bin/env bash
pbscript="/Users/ccorwin/Google Drive/Documents/pasteboard.html"
touch "${pbscript}"
pbpaste > "${pbscript}"
highlight -O rtf -t 2 -K 11 -k 'Source Code Pro' --syntax 'html' "${pbscript}" | pbcopy
#!/usr/bin/env bash
pbscript="/Users/ccorwin/Google Drive/Documents/pasteboard.js"
touch "${pbscript}"
pbpaste > "${pbscript}"
highlight -O rtf -t 2 -K 11 -k 'Source Code Pro' --syntax 'js' "${pbscript}" | pbcopy
#!/usr/bin/env bash
pbscript="/Users/ccorwin/Google Drive/Documents/pasteboard.sh"
touch "${pbscript}"
pbpaste > "${pbscript}"
highlight -O rtf -t 2 -K 11 -k 'Source Code Pro' --syntax 'Bash' "${pbscript}" | pbcopy
function throttle(fn, threshhold, scope) {
threshhold || (threshhold = 250);
var last,
deferTimer;
return function () {
var context = scope || this;
var now = +new Date,
args = arguments;
if (last && now < last + threshhold) {