Skip to content

Instantly share code, notes, and snippets.

Avatar

Jim Montgomery jimmont

View GitHub Profile
@spiralx
spiralx / computed-property.js
Created Jan 26, 2016
Use ES6 Proxy to attach computed properties
View computed-property.js
'use strict';
const VALUE = Symbol.for('value')
function addComputedProperty(obj, name, func) {
let _computed = func(obj)
return new Proxy(obj, {
get(target, key, receiver) {
if (key === name) {
@paulmillr
paulmillr / dropkick.sh
Created Dec 22, 2015
Turn off spy cams in airbnb rentals
View dropkick.sh
#!/bin/bash
#
# DROPKICK.SH
#
# Detect and Disconnect the DropCam and Withings devices some people are using to
# spy on guests in their home, especially in AirBnB rentals. Based on Glasshole.sh:
#
# http://julianoliver.com/output/log_2014-05-30_20-52
#
# This script was named by Adam Harvey (http://ahprojects.com), who also
@davestevens
davestevens / LetsEncrypt.md
Last active Dec 22, 2020
Let’s Encrypt setup for Apache, NGINX & Node.js
View LetsEncrypt.md

Let's Encrypt

Examples of getting certificates from Let's Encrypt working on Apache, NGINX and Node.js servers.

Obtain certificates

I chose to use the manual method, you have to make a file available to verify you own the domain. Follow the commands from running

git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
View css-system-fonts.css
/* https://medium.com/@mwichary/system-shock-6b1dc6d6596f#.pth6mnqx0 */
font-family: -apple-system, ".SFNSText-Regular", "San Francisco", "Oxygen", "Ubuntu", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
@paulirish
paulirish / what-forces-layout.md
Last active Jan 16, 2021
What forces layout/reflow. The comprehensive list.
View what-forces-layout.md

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@ebidel
ebidel / object-observe-proxy-polyfill.js
Last active Dec 17, 2020
Object.observe() polyfill using ES6 Proxies (POC)
View object-observe-proxy-polyfill.js
// An `Object.observe()` "polyfill" using ES6 Proxies.
//
// Current `Object.observe()` polyfills [1] rely on polling
// to watch for property changes. Proxies can do one better by
// observing property changes to an object without the need for
// polling.
//
// Known limitations of this technique:
// 1. the call signature of `Object.observe()` will return the proxy
// object. The original object needs to be overwritten with this return value.
@mbbx6spp
mbbx6spp / ALTERNATIVES.adoc
Last active Jan 15, 2021
Super quick list of alternatives to Jira and/or Confluence, Stash, Crucible, etc.
View ALTERNATIVES.adoc
@remy
remy / peek.js
Last active Aug 29, 2015
Is this okay? The peek will just act as a benign through stream letting us see the first item. Would this add much overhead to the time do you think?
View peek.js
var peek = module.exports = function (fn) {
var peeked = false;
return through(function write(data) {
this.emit('data', data);
if (peeked) {
return;
}
peeked = true;
var stream = this;
var cont = function (end) {
@hallahan
hallahan / featuresAt-mapbox-gl-js.md
Last active May 8, 2016
I'm going through the code execution of `featuresAt` in Mapbox GL JS. This is to take notes and understand how all of this works.
View featuresAt-mapbox-gl-js.md

How FeaturesAt Works in MapboxGL JS

I'm going through the code execution of featuresAt in Mapbox GL JS. This is to take notes and understand how all of this works.

featuresat.html

Initiating the feature search based on the example on Mapbox GL API Docs...

map.on('click', function(e) {
View es6mixin.js
var Bar1 = base => class extends base {
componentWillMount(){
super.componentWillMount();
console.log('Bar1');
}
};
var Bar2 = base => class extends base {
componentWillMount(){
super.componentWillMount();
You can’t perform that action at this time.