Skip to content

Instantly share code, notes, and snippets.

View acobster's full-sized avatar

Coby Tamayo acobster

View GitHub Profile
@acobster
acobster / poc.ino
Created June 21, 2017 05:05
fclooper
#include <Bounce2.h>
const int channel = 9;
const int LED = 14;
const int POT = 15;
const int DEBOUNCE_INTERVAL = 55;
int level;
@acobster
acobster / instructions.md
Created January 30, 2018 21:11
Scenario 4 Instructions
  1. Retrieve TRANQ GUN and BLAST Rick & Morty
  2. Retrieve 2 vials (Blue & Yellow) + AMMONIA SALTS
  3. Place BLUE VIAL into HELMET and place on Rick
  4. Wait 60 seconds and then remove HELMET
  5. Reload with YELLOW VIAL and place on Morty
  6. Wait 60 seconds then remove HELMET
  7. Drag Rick & Morty to the TV COUCH
  8. Turn on INTERDIMENSIONAL CABLE
  9. Break the AMMONIA SALTS and wave under noses
  10. When Rick & Morty awake leave the room
@acobster
acobster / .lando.yml
Created September 1, 2018 05:55
Lando Networking Issue
name: networking-bug
recipe: pantheon
config:
framework: wordpress
site: networking-bug
id: fake-site-id
@acobster
acobster / .bashrc
Last active April 18, 2019 20:36
evil
# evil cowsay cd
cd_() { if [ "$((1 + RANDOM % 10))" = 3 ]; then _out="I'm sorry $(whoami), I can't do that for you."; $(if [ $(which cowsay) ]; then echo cowsay; else echo echo; fi) "$_out"; else cd; fi }
alias cd='cd_'
@acobster
acobster / functions.php
Created March 28, 2019 23:07
Custom ACF select validation
<?php
/*
* Disallow certain choices based on post_type and/or page template
*/
add_filter('acf/prepare_field/key=field_5c6c913e0ea64', function(array $field) {
//unset($field['choices']['full-width-image-carousel']);
//unset($field['choices']['full-width-image']);
return $field;
@acobster
acobster / page-content-layouts.php
Created April 24, 2019 19:05
ACF Content Sections demo code
<?php
/**
* Author: Coby Tamayo
*/
use MyProject\Post\Page;
$page = new Page();
// Get common/site-wide data
(ns core)
(defn- keyed-by [coll f]
(into {} (map (fn [x] [(f x) x]) coll)))
(defn- vconj [coll & xs]
(vec (apply conj coll xs)))
(def people [{:name "Jeff"
:instrument "Mbira"}
@acobster
acobster / animations.cljs
Created March 4, 2020 21:51
Reagent animations with framer-motion
(ns app.motion
(:require
[framer-motion :refer (motion AnimatePresence useSpring useMotionValue useTransform useViewportScroll) :as motion]
[cljs-bean.core :refer [bean ->clj ->js]]))
(def div
(.-div motion))
(def span
(.-span motion))
(def li
(.-li motion))
@acobster
acobster / macro-playground.clj
Created March 27, 2020 16:12
Macro examples
(ns macro-playground.core)
(defmacro square [x]
`(let [x# ~x]
(* x# x#)))
(comment
;; Example expansions for the when* macro:
@acobster
acobster / smooth-scrolling.css
Last active September 13, 2020 15:19
Frontend snippets
/*
* SMOOTH SCROLLING IN PURE CSS
*
* CREDIT: https://twitter.com/zachleat/status/1296852504777457664
* DEMO: https://smooth-scrolling.glitch.me/
*/
@media (prefers-reduced-motion: no-preference) {
html {
scroll-behavior: smooth;
}