Skip to content

Instantly share code, notes, and snippets.

View arnoldsandoval's full-sized avatar
🧠

arnie arnoldsandoval

🧠
  • San Francisco, CA
  • 16:38 (UTC -07:00)
View GitHub Profile
@arnoldsandoval
arnoldsandoval / use-presence-with-tailwind.tsx
Created February 1, 2024 04:23 — forked from brandonpittman/use-presence-with-tailwind.tsx
`usePresence` with Tailwind animation utilities
import { AnimatePresence, usePresence } from "framer-motion";
import { classNames } from "~/lib/utils/class-names";
import { useCounter } from "@kyleshevlin/use-common";
import { useCallback } from "react";
const Box = ({ count }: { count: number }) => {
const [isPresent, safeToRemove] = usePresence();
const onAnimationEnd = useCallback(() => {
if (!isPresent) safeToRemove();
@arnoldsandoval
arnoldsandoval / delete-likes-from-twitter.md
Created March 31, 2021 00:38 — forked from aymericbeaumet/delete-likes-from-twitter.md
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
// ESLint config that uses JS Standard, JSX-a11y and incorporates Seasoned Standards
// Seasoned Standards: https://gist.github.com/arnoldsandoval/b65f4140a4a0d6755d1bfe404ba32f84
module.exports = {
'extends': [
'standard',
'plugin:jsx-a11y/recommended'
],
'plugins': [
@arnoldsandoval
arnoldsandoval / meta-tags.md
Created April 25, 2017 20:09 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@arnoldsandoval
arnoldsandoval / index.js
Created January 24, 2017 03:15 — forked from mrzmyr/index.js
React Native - Detect Double Tap
var Index = React.createClass({
getInitialState: function () {
return {
lastPress: 0
}
},
onPress: function () {
var delta = new Date().getTime() - this.state.lastPress;
@arnoldsandoval
arnoldsandoval / mini-redux.js
Created November 30, 2016 20:59 — forked from MarcoWorms/mini-redux.js
Redux in a nutshell
function createStore (reducers) {
var state = reducers()
const store = {
dispatch: (action) => {
state = reducers(state, action)
},
getState: () => {
return state
}
}
@arnoldsandoval
arnoldsandoval / debounce.js
Created January 29, 2016 04:50 — forked from mckamey/debounce.js
Debounce closure
/**
* Creates a function which fires only once when called in quick succession
* @param {function...} action the function to fire
* @param {number} delay amount of time until considered done, default:100ms
* @param {boolean} asap if should execute at the start of the series (true) or the end (false), default:false
* return {function} debounced function
*/
var debounce = function(action, delay, asap){
if ('function' !== typeof action) {
return null;
@arnoldsandoval
arnoldsandoval / fx.js
Last active August 27, 2015 04:08 — forked from vitalyrotari/fx.js
Vanilla JS - Fx | CSS Transition animation
(function (window, Element, undefined) {
'use strict';
var prefix = '',
eventPrefix,
vendors = { Webkit: 'webkit', Moz: '', O: 'o', ms: 'MS' },
document = window.document,
testEl = document.createElement('div'),
supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,
transform,