Skip to content

Instantly share code, notes, and snippets.

Avatar

Lawrence Gosset gosseti

View GitHub Profile
@gosseti
gosseti / artwork.json
Created July 30, 2022 16:26
artwork payload
View artwork.json
{
"id": "6c78b554-4b08-4f7d-9b5f-15ac618e6d62",
"name": "Ylop",
"description": "",
"assetScheme": "https://",
"assetHost": "f8n-production-collection-assets.imgix.net",
"assetPath": "/0x46Be8f341dbdF7Bb0890Ddb5056f62c3c034CbF6/9/nft.gif",
"assetIPFSPath": "QmQpxifUVa1LhrBgNMTWrKS1jCXbJLBbQ7Z53msjcXvSuL/nft.gif",
"metadataScheme": "https://",
"metadataHost": "ipfs.io",
@gosseti
gosseti / enum-in-array.tsx
Last active July 13, 2022 16:20
TypeScript Question
View enum-in-array.tsx
// when T is a custom type we want to infer from
// that rather than extending from any string
export function isValueInArray<T extends string>(
values: T[],
value: T | undefined
) {
return value ? values.includes(value) : false;
}
type Status = 'PENDING' | 'ERROR' | 'SUCCESS';
@gosseti
gosseti / index.html
Created March 14, 2018 18:11
CampaignMonitor form
View index.html
<form id="subForm" class="js-cm-form" action="https://www.createsend.com/t/subscribeerror?description=" method="post" data-id="A61C50BEC994754B1D79C5819EC1255CF918EA4461ABD274FF5FC92A3B4F4151F402A76763551CB7D3D4AC1E2361AFD2E85A761A108693FCE3D82C70BE5AEBD0">
<p>
<label for="fieldName">Name</label><br />
<input id="fieldName" name="cm-name" type="text" />
</p>
<p>
<label for="fieldEmail">Email</label><br />
<input id="fieldEmail" class="js-cm-email-input" name="cm-vtikrl-vtikrl" type="email" required />
</p>
@gosseti
gosseti / main.es5.js
Last active February 1, 2022 01:02
makeSpans.js
View main.es5.js
'use strict'
function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr) }
function makeSpans (selector) {
var _document$querySelect = document.querySelectorAll(selector)
var _document$querySelect2 = _toArray(_document$querySelect)
var elements = _document$querySelect2.slice(0)
return elements.map(function (element) {
@gosseti
gosseti / shots.json
Created June 28, 2017 13:19
dribbble API JSON response
View shots.json
[{
"id": 2971559,
"title": "Profiling",
"description": null,
"width": 400,
"height": 300,
"images": {
"hidpi": "https://cdn.dribbble.com/users/1/screenshots/2971559/new-profiles.jpg",
"normal": "https://cdn.dribbble.com/users/1/screenshots/2971559/new-profiles_1x.jpg",
"teaser": "https://cdn.dribbble.com/users/1/screenshots/2971559/new-profiles_teaser.jpg"
@gosseti
gosseti / gist:788a5fd8f607b7505e71
Created December 5, 2014 14:22
dokku-pg-plugin
View gist:788a5fd8f607b7505e71
Step 0 : FROM ubuntu:trusty
---> 86ce37374f40
Step 1 : MAINTAINER kload "kload@kload.fr"
---> Using cache
---> bf41e25f0a8d
Step 2 : RUN echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d; chmod +x /usr/sbin/policy-rc.d
---> Using cache
---> 2f2fc4b4f6ca
Step 3 : RUN apt-get update
---> Using cache
@gosseti
gosseti / form.html
Last active February 21, 2017 18:28
A credit card form using jQuery.payment
View form.html
<form accept-charset="UTF-8" action="/payment" class="cardInfo" method="post">
<fieldset class="cardInfo__cardDetails">
<div class="form-row cardInfo__cc-num">
<label for="cc-num"><abbr title="required">*</abbr><span>Card Number</span></label>
<div class="cc-num__wrap">
<!-- using type="tel" because type="number" doesn’t pass HTML5 form validation with jQuery.payment formatting -->
<input id="cc-num" type="tel" class="paymentInput cc-num" placeholder="•••• •••• •••• ••••" autocompletetype="cc-number" required="required">
<span class="card" aria-hidden="true"></span>
@gosseti
gosseti / modernizr-typekit
Created December 6, 2012 16:36
A Typekit snippet that uses Modernizr.load (yepnope) to asynchronously load webfonts only for in browsers that support @font-face.
View modernizr-typekit
Modernizr.load([{
test: Modernizr.fontface,
complete: function() {
TypekitConfig = {
kitId: 'xxxxxxx',
scriptTimeout: 3000
};
(function() {
var t = setTimeout(function() {
}, TypekitConfig.scriptTimeout);