Skip to content

Instantly share code, notes, and snippets.

classSet = require 'react-classset'
moment = require 'moment'
_ = require 'underscore'
moment.locale 'de'
# -----------------------------------------------------------------------------
Event = React.createClass
displayName: "Event"
workDayInMinutes: 8 * 60
import {stopEvent, hoistStatics} from 'util'
let Types= React.PropTypes,
_globalContainer= null
export const PopoverSupport= Wrapped => {
class PopoverSupport extends React.Component {
// static propTypes= Wrapped.propTypes // Won't this be nice?
@brumm
brumm / SassMeister-input.scss
Created April 13, 2015 16:42
Generated by SassMeister.com.
// ----
// libsass (v3.1.0)
// ----
$asset-pipeline: false;
@mixin font-face(
$font-family,
$file-path,
$weight: normal,
{{#tiny-table as |tableHeaderRow tableBodyRow|}}
{{component tableHeaderRow "Set" "Reps" "Weight"}}
{{#component tableHeaderRow as |tableCell|}}
{{tableCell "1"}}
{{#tableCell}} {{input value='15'}} {{/tableCell}}
{{#tableCell}} {{input value='10'}} {{/tableCell}}
{{#tableCell}} <button></button> {{/tableCell}}
{{/component}}
{{/tiny-table}}
@brumm
brumm / bookmarklet.js
Last active February 12, 2026 17:52
Find out which element is scrolling
javascript:!function() { var slice = Array.prototype.slice; function throttle(type, name, obj) { obj = obj || window; var running = false; var func = function() { if (running) { return; } running = true; requestAnimationFrame(function() { obj.dispatchEvent(new CustomEvent(name)); running = false; }); }; obj.addEventListener(type, func); } slice .call(document.querySelectorAll("*")) .filter( e => e.scrollWidth > e.offsetWidth || e.scrollHeight > e.offsetHeight ) .filter(e => { var style = window.getComputedStyle(e); return [style.overflow, style.overflowX, style.overflowY].some( e => e === "auto" || e === "scroll" ); }) .forEach(e => { var color = Math.floor(Math.random() * 16777215).toString(16); e.style.backgroundColor = "#" + color; throttle("scroll", "optimizedScroll", e); e.addEventListener("scroll", event => { console.log("%c[scroll]", "color: white; background-color:#" + color, event.target); }); }); }()
@brumm
brumm / configureStore.js
Created December 9, 2015 20:11
redux genericReducer
import {combineReducers, createStore} from "redux";
import todosActions from './actions/todos'
const genericReducer = (storeName, initialState = null, actions = {}) => {
return {
[storeName]: (state = initialState, action) => {
if (action.type === 'HYDRATE' && action.data[storeName])
return action.data[storeName]

undefined

(new (require('atom').TextEditor)).cursors[0].constructor.prototype.isVisible = -> true
'.source.css':
'rgba':
'prefix': 'rgba'
'body': 'rgba(0, 0, 0, 0.5)'
'rgbaw':
'prefix': 'rgbaw'
'body': 'rgba(255, 255, 255, 0.5)'
'.source.less':
'rgba':
'prefix': 'rgba'