Skip to content

Instantly share code, notes, and snippets.

Avatar

Jordan Coeyman acoyfellow

View GitHub Profile
@acoyfellow
acoyfellow / timestampJawn.js
Last active Oct 2, 2020
Turn a time into a time-zoned future timestamp (date-fns + date-fns-timezone)
View timestampJawn.js
const {
convertToTimeZone
} = require('date-fns-timezone');
const dateFns = require("date-fns");
const {
format,
getTime,
startOfToday,
parse,
addDays,
@acoyfellow
acoyfellow / add-hidden-data.html
Last active Oct 2, 2020
Add fields (after submission) to a leads data to PhoneSites
View add-hidden-data.html
<script>
// place this in the Page > Custom Code (Below Body)
window.beforePost= function(){
formData.myHiddenField= 'magic';
};
</script>
@acoyfellow
acoyfellow / example.html
Created Aug 8, 2020
FormSync + PhoneSites
View example.html
<!--
Add this script to your "Custom Code" section:
-->
<script src="https://rawgit.com/acoyfellow/FormSync/master/FormSync.js"></script>
View font-size-example.html
<style>
form{
font-size: 19px;
}
label[for], .label {
font-size: .85rem;
}
input{
height: 60px;
}
@acoyfellow
acoyfellow / font-size-example.html
Created Jul 31, 2020
Custom font size example
View font-size-example.html
<style>
form{
font-size: 19px;
}
label[for], .label {
font-size: .85rem;
}
input{
height: 60px;
}
View pseudocode.svelte
<script>
 import Sortable from 'sortablejs';
 import { onMount } from "svelte";
 let el;
 onMount(async () => {
 Sortable.create(el, { /* your sortable options here */ })
 });
</script>
<ul this={el}>
 <li>Reorder Me</li>
@acoyfellow
acoyfellow / example.html
Created Jun 6, 2020
Not-super-secure SMS validation
View example.html
<script>
store.preventPost = true;
var phone = document.getElementById('phone');
var code = document.getElementById('code');
var submit = document.getElementById('submit');
code.hidden = true;
code.required = false;
window.beforePost = function () {
if (store.submitCount === 1) {
@acoyfellow
acoyfellow / gist:626985e60ed1cb1668103a181abb1c6d
Created May 29, 2020
Run command when file in directory changes. This one-line script uses nodemon to watch a directory of files and run a `git push` whenever any of them change.
View gist:626985e60ed1cb1668103a181abb1c6d
npx nodemon --watch "test/**/*" --exec "git add -v -A && git commit -m 'new commit' && git push origin" -e txt
View responsive-image-links.html
View three-linked-images.html
<div class="flex items-center justify-start flex-wrap">
<a href="#" class="w-33 pa1 dim pointer">
<img src="https://picsum.photos/300/300?1"/>
<small>Label</small>
</a>
<a href="#" class="w-33 pa1 dim pointer">
<img src="https://picsum.photos/300/300?2"/>
<small>Label2</small>
You can’t perform that action at this time.