Skip to content

Instantly share code, notes, and snippets.

View AllanPooley's full-sized avatar
💃

Allan Pooley AllanPooley

💃
View GitHub Profile
@SimeonGriggs
SimeonGriggs / wordle.js
Last active February 11, 2022 09:54
Sanity Schema for Wordle
import React from 'react'
import {withDocument} from 'part:@sanity/form-builder'
import {Stack, Card, Flex, Text} from '@sanity/ui'
import {format} from 'date-fns'
const WORD_LENGTH = 5
function Guess({char, answer, index}) {
const answerSplit = answer.split('')
let tone = `default`
@johndturn
johndturn / PostLeads.md
Last active April 25, 2024 14:17
Post Leads to SFDC via JavaScript Fetch API and a Web-to-Lead form.

Post Leads to SFDC via JS Fetch API & Web-to-Lead

When working with Web-to-Lead forms, you might run into a situation where you'd like to integrate the form with your frontend framework (React, Vue, Angular, etc...). This can be accomplished quite easily using whatever HTTP library you're most comfortable with.

To demonstrate this, let's take a look at an example Web-to-Lead form, and the JavaScript required to post Leads to a SFDC org.

Example Form

<html lang="en">
@gokulkrishh
gokulkrishh / media-query.css
Last active May 4, 2024 16:17
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@mbejda
mbejda / hobbies.txt
Last active August 25, 2023 00:26
Compiled list of hobbies.
hobby
3D printing
amateur radio
scrapbook
Amateur radio
Acting
Baton twirling
Board games
Book restoration
Cabaret
@azz
azz / react+two.js.jsx
Last active April 15, 2023 14:28
Two.js and React with ES6
"use strict";
import React from "react";
import Two from "two";
class TwoTest extends React.Component {
constructor (props) {
super(props);
this.state = {
@koistya
koistya / App.js
Last active June 8, 2022 09:55
How to add `onscroll` event in ReactJS component
import React from 'react';
let lastScrollY = 0;
let ticking = false;
class App extends React.Component {
componentDidMount() {
window.addEventListener('scroll', this.handleScroll, true);
}
@hitautodestruct
hitautodestruct / readme.md
Last active September 26, 2022 11:25 — forked from anonymous/gist:4344870
Generate a custom structure for Wordpress menus.

This gist is for showing an example of a custom wordpress menu.

If you want to get more from the menu item simply have a look at the $item object. i.e:

// Will return a large object with lots of props like title, url, description, id etc.
var_dump( $item );

This code works on Wordpress 4.1.1 as of 31st of March 2015

@ykessler
ykessler / timezones
Created August 14, 2012 14:50
JSON list of time zones (Based on Olson tz database)
[
{"group":"US (Common)",
"zones":[
{"value":"America/Puerto_Rico","name":"Puerto Rico (Atlantic)"},
{"value":"America/New_York","name":"New York (Eastern)"},
{"value":"America/Chicago","name":"Chicago (Central)"},
{"value":"America/Denver","name":"Denver (Mountain)"},
{"value":"America/Phoenix","name":"Phoenix (MST)"},
{"value":"America/Los_Angeles","name":"Los Angeles (Pacific)"},
{"value":"America/Anchorage","name":"Anchorage (Alaska)"},