Skip to content

Instantly share code, notes, and snippets.

View peterschussheim's full-sized avatar

Peter Schussheim peterschussheim

View GitHub Profile
@peterschussheim
peterschussheim / styles.css
Last active March 5, 2019 23:46
testing css
.Resizer {
background: #000;
opacity: 0.2;
z-index: 1;
box-sizing: border-box;
background-clip: padding-box;
}
.Resizer:hover {
transition: all 2s ease;
@peterschussheim
peterschussheim / data.js
Last active February 25, 2019 22:10
Examples of using monaco-editor
export default {
props: [{
names: ['dan', 'jff']
}]
}
@peterschussheim
peterschussheim / readme.md
Last active October 25, 2018 15:22
Assign keyboard shortcut to toggle audio sources
  1. install switchaudio-osx
  2. decide which devices to toggle between. If you don't care about toggling through all available sources, use -n flag:
SwitchAudioSource -n
  1. use a tool such as keyboard maestro to assign a hotkey to call the applescript created earlier.
@peterschussheim
peterschussheim / launch.json
Created July 29, 2018 23:51
Example launch.json config showing how to add `runtimeArgs` and `args`, from lerna example
{
"name": "Jest my-package",
"type": "node",
"request": "launch",
"address": "localhost",
"protocol": "inspector",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/lerna",
"runtimeArgs": [
"exec",
"--scope",
@peterschussheim
peterschussheim / functions.js
Last active February 25, 2019 20:27
Flow Recipes - A practical collection of examples demonstrating how to create types and use them
//* @flow */
// Arrow function type `Foo`
type Foo = (x: ?number) => ?string | ?number
// Apply type `Foo` to `foo` arrow function expression
const foo: Foo = (x) => {
if (x) {
return x;
}
@peterschussheim
peterschussheim / .prettierrc
Last active April 9, 2019 20:20
TypeScript tslint/prettier config
{
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 80,
"proseWrap": "always",
"overrides": [
{
"files": "src/**/*.css",
"options": {
@peterschussheim
peterschussheim / index-0-non-debounced.js
Last active February 25, 2019 19:21 — forked from elijahmanor/index-0-non-debounced.js
React Debouncing Events
import React, { Component } from "react";
import { render } from "react-dom";
import "./index.css";
class Widget extends Component {
state = { text: "" };
handleChange = (e) => {
this.setState({ text: e.target.value });
};
render() {
@peterschussheim
peterschussheim / ProfileLink.js
Created April 6, 2018 15:20
Component to open a link in new tab
@peterschussheim
peterschussheim / perf.js
Created March 27, 2018 15:03
Sample function to measure performance.
/**
* https://github.com/jamiebuilds/tickedoff/blob/master/perf.js
*
*/
// @flow
'use strict';
function run(name, fn, times) {
let start = Date.now();