Skip to content

Instantly share code, notes, and snippets.

View georgebutter's full-sized avatar
👻

George Butter georgebutter

👻
  • Mindfulness.com
  • Melbourne
View GitHub Profile
@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',
@astromac
astromac / Set Content Offset
Last active May 18, 2016 03:59
Positions content below a fixed header and does this everytime the window size changes
function contentOffset() {
var droppx = /\d+/;
var navheight = $('header > .navbar').css('height');
var subnavheight = $('header > .navbar + .sub-nav').css('height');
var breadcrumbheight = $('.breadcrumb').css('height');
var offset = 0;
if ($('.page-header').length > 0) {
var pageheaderheight = $('.page-header').css('height');
offset = parseInt(navheight.match(droppx)) + parseInt(subnavheight.match(droppx)) + parseInt(breadcrumbheight.match(droppx)) + parseInt(pageheaderheight.match(droppx)) + 1;
} else {
@rxaviers
rxaviers / gist:7360908
Last active July 23, 2024 01:33
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@acacio
acacio / upnp.js
Created January 12, 2012 21:17
UPNP Port Forwarding for node.js
/* node UPNP port forwarding PoC
This is a simple way to forward ports on NAT routers with UPNP.
This is a not-for-production hack that I found useful when testing apps
on my home network behind ny NAT router.
-satori
usage: