Skip to content

Instantly share code, notes, and snippets.

View soenkekluth's full-sized avatar
🎯
Focusing

Sönke Kluth soenkekluth

🎯
Focusing
View GitHub Profile
@donnydavis
donnydavis / chromeify
Created March 12, 2018 22:27
OSX Google Chrome Appify
#!/bin/sh
#This is not new, just a few minor edits to an old script for OSX.
echo "What should the Application be called (no spaces allowed e.g. GCal)?"
read inputline
name=$inputline
echo "What is the url (e.g. https://www.google.com/calendar/render)?"
read inputline
@ngokevin
ngokevin / serviceworker.js
Last active March 12, 2023 09:52
Service Worker Template - cache-else-network + network-else-cache
var VERSION = 'v1';
var cacheFirstFiles = [
// ADDME: Add paths and URLs to pull from cache first if it has been loaded before. Else fetch from network.
// If loading from cache, fetch from network in the background to update the resource. Examples:
// 'assets/img/logo.png',
// 'assets/models/controller.gltf',
];
@304352303
304352303 / dabblet.css
Created February 11, 2018 03:55 — forked from csssecrets/dabblet.css
Smooth state animations
/**
* Smooth state animations
* Photo credits: https://www.flickr.com/photos/employtheskinnyboy/3904743709
*/
@keyframes panoramic {
to { background-position: 100% 0; }
}
.panoramic {
@developit
developit / demo.html
Last active May 12, 2017 14:31
Just bundle embed.js via webpack with target:umd and the name "embed" (or pick one)
<script src="/path/to/embed.umd.js"></script>
<div id="foo"></div>
<script>
var parent = document.getElementById('foo')
embed.renderWidget(
'foo', // widget name
{ a: 'b' }, // props
parent // render into this
);
@phun-ky
phun-ky / webpack.config.js
Last active July 10, 2018 10:51
webpack + postcss + extract-text-plugin = no CSS duplicates
postcss: () => {
return [
cssnano({
reduceIdents: false,
discardDuplicates: true,
autoprefixer: true
})
];
},modules: {
loaders: [{

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@xgin
xgin / letsencrypt-hostname.sh
Created January 4, 2016 07:29
Secure plesk clean installation with hostname certificate by Let's Encrypt
#!/bin/bash -e
### Copyright 1999-2015. Parallels IP Holdings GmbH. All Rights Reserved.
### Secure plesk clean installation with hostname certificate by Let's Encrypt
export PYTHONWARNINGS="ignore:Non-standard path"
LE_HOME=${LE_HOME:-"/usr/local/psa/var/modules/letsencrypt"}
HOSTNAME=$(hostname)
# Use staging server for testing
# --server https://acme-staging.api.letsencrypt.org/directory
@alexpchin
alexpchin / socket-cheatsheet.js
Created December 15, 2015 16:58
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender
@zackify
zackify / .eslintrc
Last active December 21, 2015 17:57
Upgrade to Babel 6
{
"parser": "babel-eslint",
"env": {
"es6": true,
"mocha": true,
"node": true
},
"ecmaFeatures": {
"blockBindings": true,
"forOf": true,
@paulirish
paulirish / what-forces-layout.md
Last active May 6, 2024 07:54
What forces layout/reflow. The comprehensive list.

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