Skip to content

Instantly share code, notes, and snippets.

View crswll's full-sized avatar
💾

Bill Criswell crswll

💾
  • Philadelphia, PA
  • 05:36 (UTC -04:00)
  • X @crswll
View GitHub Profile
@bramus
bramus / bookmarklet.md
Last active August 3, 2023 16:56
Mastodon User Page Bookmarklet
overscroll-b: overscroll-y
overscroll-i: overscroll-x
bs: height
is: width
min-bs: min-height
min-is: min-width
max-bs: max-height
max-is: max-width
mlb: my
mli: mx
@aprilmintacpineda
aprilmintacpineda / Using Multiple SSH keys - Beginner Friendly.md
Last active May 6, 2024 05:32
Beginner Friendly: Using Multiple SSH keys

How to follow this guide

The problem

I have one computer and two different github accounts. One is for work, the other is for my personal stuff. I can't use the same ssh key twice, so I have to use different ssh key for each of my accounts. How do I do that? How do I switch between these ssh keys?

const marky = require('marky')
const render = Vue.prototype._render
const update = Vue.prototype._update
const camelize = str => str && Vue.util.camelize(str)
function getName (vm) {
if (!vm.$parent) return 'root'
return (
camelize(vm.$options.name) ||
camelize(vm.$options._componentTag) ||
@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
@bryanrsmith
bryanrsmith / fetch-client.js
Last active April 12, 2020 16:21
A thin wrapper library around the fetch API to provide application-wide HTTP client configuration
export class HttpClient {
constructor(defaults) {
this.defaults = defaults;
this.interceptors = [];
this.activeRequestCount = 0;
this.isRequesting = false;
}
addInterceptor(interceptor) {
this.interceptors.push(interceptor);
@branneman
branneman / better-nodejs-require-paths.md
Last active April 27, 2024 04:16
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@cobyism
cobyism / gh-pages-deploy.md
Last active May 6, 2024 08:07
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@conorbuck
conorbuck / angle-between-points.js
Created May 5, 2012 22:51
JavaScript: Find the angle between two points
var p1 = {
x: 20,
y: 20
};
var p2 = {
x: 40,
y: 40
};