Skip to content

Instantly share code, notes, and snippets.

View otaviosoares's full-sized avatar

Otávio Augusto Soares otaviosoares

View GitHub Profile
@jh3y
jh3y / gsap-eases.css
Last active July 25, 2024 10:06
GreenSock eases with CSS linear()
:root {
--none: linear(0, 1);
--power1-in: linear( 0, 0.0039, 0.0156, 0.0352, 0.0625, 0.0977, 0.1407, 0.1914, 0.2499, 0.3164, 0.3906 62.5%, 0.5625, 0.7656, 1 );
--power1-out: linear( 0, 0.2342, 0.4374, 0.6093 37.49%, 0.6835, 0.7499, 0.8086, 0.8593, 0.9023, 0.9375, 0.9648, 0.9844, 0.9961, 1 );
--power1-in-out: linear( 0, 0.0027, 0.0106 7.29%, 0.0425, 0.0957, 0.1701 29.16%, 0.2477, 0.3401 41.23%, 0.5982 55.18%, 0.7044 61.56%, 0.7987, 0.875 75%, 0.9297, 0.9687, 0.9922, 1 );
--power2-in: linear( 0, 0.0014 11.11%, 0.0071 19.24%, 0.0188 26.6%, 0.037 33.33%, 0.0634 39.87%, 0.0978 46.07%, 0.1407 52.02%, 0.1925 57.74%, 0.2559 63.49%, 0.3295 69.07%, 0.4135 74.5%, 0.5083 79.81%, 0.6141 85%, 0.7312 90.09%, 1 );
--power2-out: linear( 0, 0.2688 9.91%, 0.3859 15%, 0.4917 20.19%, 0.5865 25.5%, 0.6705 30.93%, 0.7441 36.51%, 0.8075 42.26%, 0.8593 47.98%, 0.9022 53.93%, 0.9366 60.13%, 0.963 66.67%, 0.9812 73.4%, 0.9929 80.76%, 0.9986 88.89%, 1 );
--power2-in-out: linear( 0, 0.0036 9.62%, 0.0185 16.66
@gcjbr
gcjbr / script.js
Created January 15, 2022 00:32
Script para livrar sua timeline do Twitter do INFERNO do BBB
const delayMs = 1000;
const keywords = ["#redeBBB","Big Brother","bbb","#BBB","#BBB22","#BBB222","#BBBB22","boninho","b0ninho","b0ninh0","boninh0","globoplay","Tadeu Schmidt","Schmidt","schimit","Pedro Scooby","Scooby","Arthur Aguiar","Brunna Gonçalves","Rhudson Victor","Rhudson","Rafa Kalimann","Kalimann","Luciano Estevan","Eslovenia Marques","Lucas Bissoli","lais caldas","Bissoli","Barbara Heck","Heck","Rodrigo Mussi","Mussi","Natalia Deodato","Paulo Andre Camilo","bigfone","bigphone","paredão","paredawn","paredaum","Eslovenia","Eliezer","Eli","Jessilane","Lais","Paulo Andre","Andre Camilo","anjo","imunidade","votação","projac"];
const nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value").set;
const addMutedKeyword = keyword => {
const input = document.querySelector("[name='keyword']");
nativeInputValueSetter.call(input, keyword);
input.dispatchEvent(new Event('input', { bubbles: true }));
@rishitells
rishitells / Jest_GitLab_CI.md
Last active July 23, 2024 10:39
Setting up Jest tests and coverage in GitLab CI

Configuring Jest Tests in GitLab CI

1. Add GitLab CI configuration file in the root

In the root of your project, add .gitlab-ci.yml with the configuration below.

image: node:latest

stages:
@sindresorhus
sindresorhus / esm-package.md
Last active July 25, 2024 04:47
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@jbutko
jbutko / react-js-to-ts-files-rename.md
Last active July 21, 2022 23:09
React: JavaScript to TypeScript files rename

Rename "js" to "tsx" files with exception to "index.js"|"*.test.js"

find . -type f \( -name "*.js" -and -not -name "*.styles.js" -and -not -name "index.js" -and -not -name "*.test.js" \) -exec sh -c 'mv "$1" "${1%.js}.tsx"' _ {} ;

Rename non "tsx" files to "ts" (index.js | *.styles.js) except *.test.js files

find . -type f \( -name "*.js" -and -not -name "*.test.js" \) -exec sh -c 'mv "$1" "${1%.js}.ts"' _ {} ;

Rename all "js" files containing text "import React from 'react'" to "tsx"

find . -type f \( -name "*.js" \) -exec grep -l "import React" {} ; -exec sh -c 'mv "$1" "${1%.js}.tsx"' _ {} ;

Rename all "js" files containing text "import * as React from 'react'" to "tsx"

@axemclion
axemclion / PerfLogger.java
Last active August 12, 2023 02:56
React Native Android - Systrace from ReactMarkers
package com.nparashuram;
import android.os.Process;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.ViewTreeObserver;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.bridge.ReactContext;
kubectl get pods -a | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
@Geoff-Ford
Geoff-Ford / master-javascript-interview.md
Last active July 18, 2024 08:32
Eric Elliott's Master the JavaScript Interview Series
@Dufgui
Dufgui / gist:72debe81068bf3ecd7d8
Last active April 25, 2023 14:34 — forked from eduardocardoso/gist:82a629882ddb02ab3677
Script to delete exited containers and untagged/unused images from docker
#!/bin/bash
set -o errexit
echo "Removing exited docker containers..."
docker ps -a -f status=exited -q | xargs -r docker rm -v
echo "Removing dangling images..."
docker images --no-trunc -q -f dangling=true | xargs -r docker rmi
@Bogdaan
Bogdaan / Hhvm.php
Last active February 16, 2016 18:36
Yii-1.x hhvm error handler hack
<?php
/**
* How to prevent "white page" on CHttpException and other errors
*
* Instruction:
* 1. place Hhvm.php to protected.components
* 2. add to index.php lines:
*
* define('YII_DEBUG', false);