Skip to content

Instantly share code, notes, and snippets.

View andresgcarmona's full-sized avatar
🎯
Focusing

Andrés G. Carmona andresgcarmona

🎯
Focusing
View GitHub Profile
@andresgcarmona
andresgcarmona / animation.css
Created October 8, 2022 13:42
Animaiton system
/* ==========================================================================
Animation System by Neale Van Fleet from Rogue Amoeba
========================================================================== */
.animate {
animation-duration: 0.75s;
animation-delay: 0.5s;
animation-name: animate-fade;
animation-timing-function: cubic-bezier(.26, .53, .74, 1.48);
animation-fill-mode: backwards;
}
@andresgcarmona
andresgcarmona / step_animation.css
Last active October 8, 2022 13:33
CSS step animation
.hi {
width: 50px;
height: 72px;
background-image: url("http://s.cdpn.io/79/sprite-steps.png");
-webkit-animation: play .8s steps(10) infinite;
-moz-animation: play .8s steps(10) infinite;
-ms-animation: play .8s steps(10) infinite;
-o-animation: play .8s steps(10) infinite;
animation: play .8s steps(10) infinite;
@andresgcarmona
andresgcarmona / humanFileSize.js
Created September 28, 2022 11:26
File size human readable
function humanFileSize(bytes, si=false, dp=1) {
const thresh = si ? 1000 : 1024;
if (Math.abs(bytes) < thresh) {
return bytes + ' B';
}
const units = si
? ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
: ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];
import React, { useState, useEffect, useCallback, startTransition } from "react";
// library code
const createStore = (initialState) => {
let state = initialState;
const getState = () => state;
const listeners = new Set();
const setState = (fn) => {
state = fn(state);

Keybase proof

I hereby claim:

  • I am andresgcarmona on github.
  • I am andres_gcarmona (https://keybase.io/andres_gcarmona) on keybase.
  • I have a public key ASDmwr-p10yss5aPZX6v1CCaiBcBJGws2zM5LOFCEZGAAgo

To claim this, I am signing this object:

@andresgcarmona
andresgcarmona / App.js
Created March 24, 2021 03:33
Three.js startup project.
import Scene from './Scene'
export default class App {
constructor () {
this.onResize()
this.bindEvents()
this.scene = new Scene(this)
}
@andresgcarmona
andresgcarmona / README.md
Last active March 17, 2021 18:58
First gist to test Github gists

It works!

From Wikipedia:

Epicyclic gearing or planetary gearing is a gear system consisting of one or more outer gears, or planet gears, revolving about a central, or sun gear. … Epicyclic gearing systems also incorporate the use of an outer ring gear or annulus, which meshes with the planet gears.

Use the menu in the top-left to change the frame of reference, fixing the specified gear in-place.

@andresgcarmona
andresgcarmona / login.dart
Created September 29, 2020 03:18
Login form for Flutter
import 'package:flutter/material.dart';
class LoginForm extends StatefulWidget {
@override
_LoginFormState createState() => _LoginFormState();
}
class _LoginFormState extends State<LoginForm> {
final _formKey = GlobalKey<FormState>();
final _emailController = TextEditingController();
/*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*!
* Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=3356eb28a4f746ca1528)
* Config saved to config.json and https://gist.github.com/3356eb28a4f746ca1528
*/
/*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*!
* Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=3356eb28a4f746ca1528)
* Config saved to config.json and https://gist.github.com/3356eb28a4f746ca1528
*/