Skip to content

Instantly share code, notes, and snippets.

View jasmo2's full-sized avatar

Jaime Molina jasmo2

  • All over the World
View GitHub Profile
var intervalTime = 2000
var intervalFunc = setInterval(()=> {
const btns = btn = document.getElementsByClassName("Bgi($g-ds-background-like):a")
const likeBtn = btns[0]
likeBtn.click()
}, intervalTime)
"scripts":{
"test:debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand --watch",
}
import { useContext } from "react"
export function useContextFactory<T>(name: string, context: React.Context<T>) {
return () => {
const ctx = useContext(context)
if (ctx === undefined) {
throw new Error(
`use${name}Context must be used withing a ${name}ContextProvider.`
)
}
alter table(:qa_job) do
add :body, :jsonb
add :input, :jsonb
add :output, :jsonb
end
@jasmo2
jasmo2 / firebase-runtimeconfig-parser-uploader.js
Last active August 4, 2020 21:59
This script will upload wha is set inside `.runtimeconfig.json` * to firebase functions - jasmo2
/*
* NOTE: this file will upload wha is set inside `.runtimeconfig.json`
* to firebase functions.
*
* To run go to root in the project and run:
* cat .runtimeconfig.json | node ./parser.js
*/
const stdin = process.openStdin()
const spawn = require('child_process').spawn
@jasmo2
jasmo2 / .prettierrc
Last active July 28, 2020 22:02
Common Config files
{
"editorconfig": true,
"trailingComma": "es5",
"semi": false,
"singleQuote": true,
"jsxBracketSameLine": false,
"arrowParens": "always",
"printWidth": 80
}
/*
* in package.json set the next script:
* "update-refs": "node update-refs.js ENVIRONTMENT_A && node update-refs.js ENVIRONTMENT_B && ... && node update-refs.js ENVIRONTMENT_i && git add ."
*/
const fs = require('fs')
const axios = require('axios')
const saveRef = (envFile, ref) => {
const envDev = fs.readFileSync(envFile, {
encoding: 'utf8',
function isFlattenable(value) {
return Array.isArray(value)
}
function flattenImplementation (array, depth = Infinity, isStrict, result = []) {
let index = -1
let length = array.length
while (++index < length) {
var value = array[index]
import React, { useState } from 'react'
import get from 'ts-get'
import { useTheme } from 'emotion-theming'
import styled from '~/theme/types'
import Navbar from '~/components/organisms/Header'
import Footer from '~/components/organisms/Footer'
interface BlogPageProps {
location: {

UI Developer

Jaime Molina