Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexandr Priezzhev priezz

View GitHub Profile
@sausman
sausman / CyaSS.jsx
Created Feb 21, 2015
CyaSS React Component - mimic :hover and :active with inline styles
View CyaSS.jsx
import React from "react/addons";
import m from "./m";
// https://www.youtube.com/watch?v=GOiVYbWJDOA
export default class CyaSS extends React.Component {
constructor() {
super();
this.state = {
hover: false,
active: false
@mmazzarolo
mmazzarolo / mobxLogger.js
Created May 30, 2016
While waiting for React-Native MobX devtools...
View mobxLogger.js
import mobx from 'mobx'
const DEFAULT_STYLE = 'color: #006d92; font-weight:bold;'
// Just call this function after MobX initialization
// As argument you can pass an object with:
// - collapsed: true -> shows the log collapsed
// - style -> the style applied to the action description
export const startLogging = ({ collapsed, style } = {}) => {
mobx.spy(event => {
View export-toby.js
// code courtesy of Toby team
chrome.storage.local.get("state", o => (
((f, t) => {
let e = document.createElement("a");
e.setAttribute("href", `data:text/plain;charset=utf-8,${encodeURIComponent(t)}`);
e.setAttribute("download", f);
e.click();
})(`TobyBackup${Date.now()}.json`, o.state)
));