Skip to content

Instantly share code, notes, and snippets.

@AbeCole
AbeCole / sanity_asset_custom_field.tsx
Last active December 12, 2023 21:16
Sanity - Custom input component for managing Asset metadata
// Use with Sanity schema on your existing 'image' field, add a subfields option:
// The subfield 'options.field' attribute defines which asset field we are managing
// If no 'options.field' is provided, the 'title' attribute will be downcased and used (i.e. Title -> title)
//
// {
// title: 'Image',
// name: 'image',
// type: 'image',
// fields: [
// {
### Keybase proof
I hereby claim:
* I am AbeCole on github.
* I am abec (https://keybase.io/abec) on keybase.
* I have a public key whose fingerprint is C869 896D C2A7 3471 CE67 8C67 DEB9 89E4 9DC3 7EF3
To claim this, I am signing this object:
require 'net/http'
require 'json'
API_TOKEN = 'YOUR_API_TOKEN'
data = {
:event => 'client/create',
:target_url => 'CALLBACK_URL_HERE'
}
@AbeCole
AbeCole / 0_reuse_code.js
Created November 14, 2013 17:57
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@AbeCole
AbeCole / Upload.php
Created November 14, 2013 17:55
Modification to ExpressionEngine's CodeIgniter based Upload library. Forces directories to be created if they don't exist. CodeIgniter/system/libraries/Upload.php
// --------------------------------------------------------------------
/**
* Validate Upload Path
*
* Verifies that it is a valid upload path with proper permissions.
*
*
* @return bool
*/