Skip to content

Instantly share code, notes, and snippets.

@bjoerge
bjoerge / ExternalDataInput.js
Created December 21, 2018 12:46
Example of a custom sanity input that allows the user to select from a list of values retrieved from an external API
import React from 'react'
import SearchableSelect from 'part:@sanity/components/selects/searchable'
import FormField from 'part:@sanity/components/formfields/default'
import {PatchEvent, set, unset} from 'part:@sanity/form-builder/patch-event'
const STREET_NAMES = [
'Thorvald Meyers gate',
'Champs-Élysées',
'Lombard Street',
'Abbey Road',
@craigspaeth
craigspaeth / baobab-vs-redux.md
Last active August 9, 2020 14:31
Baobab vs. Redux

Thoughts on Redux vs. Baobab

I'm going to write down my thoughts on these two libraries that I'm conflicted between.

Disclaimer: These are just my personal stream of consciousness notes and not meant to be a well thought through blog post/opinion piece. Both these libraries are fantastic and the authors deserve huge props/respect. If you find these musings helpful I'm glad, but I encourage you to take it with a grain of salt.

Intro

@justjanne
justjanne / Price Breakdown.md
Last active April 11, 2024 22:21 — forked from kylemanna/price.txt
Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Permalink: git.io/vps

$5/mo

Provider Type RAM Cores Storage Transfer Network Price
@wearhere
wearhere / LocalCollection.js
Last active October 4, 2021 18:35
A small, browser-only, read-only client for a Meteor backend. More info and examples at https://mixmax.com/blog/meteor-and-backbone.
/**
* A very lightweight version of Meteor's Minimongo collections,
* a local store for records sent from the Meteor backend.
*/
var LocalCollection = function() {
this._initialize();
};
_.extend(LocalCollection.prototype, Backbone.Events, {
_name: null,
(function() {
Backbone.Events.autorun = function(f, context) {
if (!this.__autorunHandles) this.__autorunHandles = [];
var backboneContext = this;
var handle = Tracker.autorun(function() {
Tracker.currentComputation.__backboneContext = backboneContext;
f();
});
this.__autorunHandles.push(handle);
return handle;
@tamagokun
tamagokun / bbf-sortable-list.js
Last active August 29, 2015 14:03
bbf-sortable-list.js
Form.editors.SortableList = Form.editors.List.extend({
initialize: function() {
Form.editors.List.prototype.initialize.apply(this, arguments);
},
render: function() {
Form.editors.List.prototype.render.apply(this, arguments);
// sorting
if (!this.sortable) {
@mzabriskie
mzabriskie / README.md
Last active May 22, 2024 16:53
Check git status of multiple repos

If you're like me you have a dir like ~/Workspace/Github where all your git repos live. I often find myself making a change in a repo, getting side tracked and ending up in another repo, or off doing something else all together. After a while I end up with several repos with modifications. This script helps me pick up where I left off by checking the status of all my repos, instead of having to check each one individually.

Usage:

git-status [directory]

This will run git status on each repo under the directory specified. If called with no directory provided it will default to the current directory.

@TimNZ
TimNZ / marionette.gauntlet.js
Last active December 12, 2015 05:28 — forked from mxriverlynn/marionette.gauntlet.js
Various enhancements
// Marionette.Gauntlet v0.0.0
// --------------------------
//
// Build wizard-style workflows with an event-emitting state machine
// Requires Backbone.Picky (http://github.com/derickbailey/backbone.picky)
//
// Copyright (C) 2012 Muted Solutions, LLC.
// Distributed under MIT license
// Modifications by Tim Shnaider
//
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 5, 2024 22:16
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@aslakhellesoy
aslakhellesoy / Makefile
Created December 20, 2011 09:43
Fetch NPM modules with Make
node_modules: Makefile
@rm -rf $@
@mkdir -p $@
$(call get_src_module,$@,https://github.com/tastapod/node-imap/tarball/bruno-merge)
$(call get_npm_module,$@,log,1.2.0)
$(call get_npm_module,$@,connect,1.8.2)
# We have to manually fetch connect's dependencies
$(call get_npm_module,$@,qs,0.4.0)
$(call get_npm_module,$@,mime,1.2.4)
$(call get_npm_module,$@,formidable,1.0.8)