Skip to content

Instantly share code, notes, and snippets.

@sausman
sausman / CyaSS.jsx
Created February 21, 2015 22:13
CyaSS React Component - mimic :hover and :active with inline styles
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 13:10
While waiting for React-Native MobX devtools...
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 => {
@krishpop
krishpop / export-toby.js
Last active March 21, 2024 22:12
Export Toby
// 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)
));
@hjbotha
hjbotha / free_ports.sh
Last active April 22, 2024 14:52
Free ports 80 and 443 on Synology NAS
#! /bin/bash
# NEWLY ADDED BACKUP FUNCTIONALITY IS NOT FULLY TESTED YET, USE WITH CARE, ESPECIALLY DELETION
# Developed for DSM 6 - 7.0.1. Not tested on other versions.
# Steps to install
# Save this script in one of your shares
# Edit it according to your requirements
# Backup /usr/syno/share/nginx/ as follows:
# # cd /usr/syno/share/
# # tar cvf ~/nginx.tar nginx