Skip to content

Instantly share code, notes, and snippets.

View jaydenseric's full-sized avatar
🇦🇺
Deno, Node.js, GraphQL & React

Jayden Seric jaydenseric

🇦🇺
Deno, Node.js, GraphQL & React
View GitHub Profile
# I battled for hours trying to install imagick via macports, trying to follow various tutorials.
# If you've been battling with macports, completely uninstall everything related to
# macports (http://guide.macports.org/chunked/installing.macports.uninstalling.html)
# and trying with Home Brew instead, using the instructions below
# install brew (http://mxcl.github.com/homebrew/)
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
# install imagemagick
@helfer
helfer / apollo-1-migration.md
Last active May 31, 2017 01:09
Migrating from Apollo Client 0.x to 1.0

Migrating from Apollo Client 0.x to 1.0

Here are the main breaking changes between the 0.x and 1.0 versions of Apollo Client.

fetchMore

The structure of fetchMoreResult has been changed. Previously fetchMoreResult used to contain data and loading fields, now fetchMoreResult is what fetchMoreResult.data used to be. This means your updateQueries function has to change as follows:

updateQuery: (prev, { fetchMoreResult }) => {
@lancewalton
lancewalton / gource.sh
Last active January 11, 2018 23:37
Produces a video of the evolution of a git repository using gource (see https://code.google.com/p/gource/). Also downloads committers' gravatars to use on the video.
#!/bin/zsh
# For Macs, get gource with HomeBrew:
# brew install gource
# brew install ffmpeg
if (( !($# == 3) ))
then
echo "Usage:"
echo $0 "<gravatar directory> <output file base name> <seconds per day>"
@umidjons
umidjons / authenticate-nodejs-api-with-jsonwebtoken.md
Last active August 10, 2018 11:48
Authenticate a Node.js API with JSON Web Tokens
@GeoffreyBooth
GeoffreyBooth / npm-packages-module-field-analysis.md
Last active November 22, 2018 11:16
Analysis of public NPM packages using the “module” field

I did some research into the package.json "module" field. I wrote some code to download all the the package.json files from all the public packages in the NPM registry. Here are some findings:

941 public NPM packages use the "module" field as of 2018-10-22.

Here are the top 30 packages, as ranked by number of public dependents (or see the full list):

Dependents Package Name "module" Field Value
16,286 should ./es6/should.js
15,472 sinon ./pkg/sinon-esm.js
export function loadConfigModule(filename) {
// sub your own
return require(filename);
}
/**
* Modify a Webpack configuration by applying a mutator module/function.
* @param {Object} options
* @param {Object} options.config Webpack configuration object to modify in-place
import ReactDOM from "react-dom";
export default ReactDOM.unstable_batchedUpdates;
@stucox
stucox / mutationobserver.js
Created March 24, 2013 09:36
Mutation Observer feature detection
// http://www.w3.org/TR/dom/
// http://updates.html5rocks.com/2012/02/Detect-DOM-changes-with-Mutation-Observers
// https://developer.mozilla.org/en-US/docs/DOM/MutationObserver
var MutationObserver = (function () {
var prefixes = ['WebKit', 'Moz', 'O', 'Ms', '']
for(var i=0; i < prefixes.length; i++) {
if(prefixes[i] + 'MutationObserver' in window) {
return window[prefixes[i] + 'MutationObserver'];
}
}
@leongersen
leongersen / nouislider-inline.js
Last active August 28, 2020 07:43
A small handler to initialize noUiSlider with inline attributes. Implementation is roughly inspired by, but not fully compatible to, the specification for input[type="range"]. Attributes with or without the 'data-' prefix will be handled.
(function(){
'use strict';
$('[data-slider]').each(function(){
function d(a,b){
return parseFloat(a.attr(b) || a.attr('data-'+b));
}
@smockle
smockle / One Dark.terminal
Created February 18, 2015 23:34
An OS X Terminal profile to match Atom Editor's One Dark syntax theme. Thanks to https://github.com/nathanbuchar/one-dark-terminal for the inspiration!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NGMCAw
IDAAEAGAAtIQERITWiRjbGFzc25hbWVYJGNsYXNzZXNXTlNDb2xvcqISFFhOU09iamVj
dF8QD05TS2V5ZWRBcmNoaXZlctEXGFRyb290gAEIERojLTI3O0FITltiaWttcn2GjpGa