Skip to content

Instantly share code, notes, and snippets.

Deploybot
running
pause -> paused
continue -> running
stop -> stopped
paused
pause -> paused
continue -> running
stop -> stopped
// 1. Second dynamic argument — first is "guarenteed" to not interpolate
const Button = styled.button(`
/* Adapt the colors based on primary prop */
font-size: 1em;
margin: 1em;
padding: 0.25em 1em;
border: 2px solid palevioletred;
border-radius: 3px;
`, (props) => `
const Button = styled.button`
/* Adapt the colors based on primary prop */
background: ${props => window.innerWidth < 1000 ? 'palevioletred' : 'white'};
color: ${props => window.innerWidth < 1000 ? 'white' : 'palevioletred'};
font-size: 1em;
margin: 1em;
padding: 0.25em 1em;
border: 2px solid palevioletred;
border-radius: 3px;
Arithmetic {
Exp
= ComposeExp ("," ComposeExp ) * end
ComposeExp
= exportIdent + Source ?
Source
= "from" url
#!/bin/bash
i="0"
while [ $i -gt -1 ]
do
i=$[$i+1]
echo $i
(
node bot.js ws://localhost:5000
var WebSocket = require('ws')
var ws = new WebSocket('ws://localhost:5000')
function rand(lim) {
return Math.floor(Math.random(lim) * lim)
}
function sample(col) {
return col[rand(col.length)]
function cssmodularize(strings) {
/* TODO: Un-stub */
return {
'.foo': 'Button-foo-abcd'
}
}
class Button {
static styles = cssmodularize`
/*
This file was autogenerated from Meta's CSS. I tried getting
postcss-for working but it turns out it's a massive PITA. /shrug
~ @chrislloyd
*/
@media (--breakpoint-sm) {
.sm-m0 { margin: 0 }
.sm-mt0 { margin-top: 0 }
.sm-mr0 { margin-right: 0 }
@chrislloyd
chrislloyd / whitespace.rb
Created May 5, 2015 02:00
BASS Responsive whitespace helpers
# ruby whitespace.rb | pbcopy
%w(sm md lg).each do |breakpoint|
puts "@media (--breakpoint-#{breakpoint}) {"
{
0 => ['0', '0'],
1 => ['var(--space-1)', 'calc(0 - var(--space-1))'],
2 => ['var(--space-2)', 'calc(0 - var(--space-2))'],
3 => ['var(--space-3)', 'calc(0 - var(--space-3))'],
@chrislloyd
chrislloyd / nonoptimistic.js
Created February 19, 2015 16:37
up vote widget
// in this version, the user clicks the button, the request is sent to the server and the number of upvotes
// is only updated when the response comes back
handleClick: function(e) {
e.preventDefault();
this.upvote();
},
upvote: function() {
// Not sure what the state name is here, just need this to toggle the button immediately