Skip to content

Instantly share code, notes, and snippets.

View pbroschwitz's full-sized avatar

Peter Broschwitz pbroschwitz

View GitHub Profile
// keybindings.json
// Toggle between terminal and editor focus
{ "key": "ctrl+shift+oem_3", "command": "workbench.action.terminal.focus"},
{ "key": "ctrl+shift+oem_3", "command": "workbench.action.focusActiveEditorGroup", "when": "terminalFocus"}
@pbroschwitz
pbroschwitz / Pure-functions.html
Last active February 11, 2017 08:43
Pure functions / impure functions
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Pure functions</title>
</head>
<body>
<p>Reference: <a href="https://egghead.io/lessons/javascript-redux-pure-and-impure-functions">Egghead</a></p>
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.rawgit.com/zloirock/core-js/master/client/shim.min.js"></script>
<script src="https://wzrd.in/standalone/tape@latest"></script>
<script src="https://wzrd.in/standalone/tap-browser-color@latest"></script>
<script src="http://fb.me/react-with-addons-0.14.3.js"></script>
<script src="http://fb.me/react-dom-0.14.3.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Factory Pattern</title>
<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
<meta name="author" content="Hakim El Hattab">
onScroll(): () => void {
var last, timeout, threshold = 100;
return () => {
var now = Date.now();
if (last && now < last + threshold) {
window.clearTimeout(timeout);
timeout = window.setTimeout(function () {
last = now;
// Custom event listening
$(document).on('historyslider:initvideo', function (event) {
var args: any = [].slice.call(arguments),
players = args.length > 1 ? args[1] : $();
_this.initVideo(players);
});
@pbroschwitz
pbroschwitz / index.html
Last active February 10, 2016 09:33
Classical Reuse Patterns / JavaScript
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Classical Pattern - Code Reuse Pattern</title>
<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
<meta name="author" content="Hakim El Hattab">
function aContainsB (a, b) {
return a.indexOf(b) >= 0;
}
var philosophers = "Aquinas, Maimonedes, and Avicenna";
var me = "Joshua";
function printPhilosopherStatus (person) {
if (aContainsB(philosophers, person)) {
console.log(person + " is a philosopher.");
@pbroschwitz
pbroschwitz / 1. elements.html
Created July 3, 2013 17:09 — forked from Integralist/1. elements.html
Checkbox Hack (works in modern browsers and IE9+)
<label for="toggle-1">I'm a toggle</label>
<input type="checkbox" id="toggle-1">
<div>I'm controlled by toggle. No JavaScript!</div>
@pbroschwitz
pbroschwitz / dabblet.css
Created June 4, 2013 10:36 — forked from anselmh/dabblet.css
Untitled
.overflowed > p{
width: 10em;
height: 5rem;
white-space: pre-line;
overflow: hidden;
outline: 1px dashed lime;
}
.overflowed-clip {
text-overflow: clip;