Skip to content

Instantly share code, notes, and snippets.

@listiani13
listiani13 / fetching-in-console
Created January 30, 2018 16:01
Fetching data from github API
fetch('https://api.github.com/orgs/kodefox/repos')
.then((resp)=>{
resp.json().then((data) => {
data.forEach((item)=>{
fetchRepo(item.name);
});
})
});
let fetchRepo = (name)=>{
ffmpeg -i 'fix chart.mov' -vf scale=600:-1 -r 10 output/ffout%3d.png
convert -delay 8 -loop 0 output/ffout*.png output/animation.gif
ffmpeg -i <<path to mov file>> -vf scale=600:-1 -r 10 <<path to output folder>>
convert -delay 8 -loop 0 <<path to input image file>> <<path to output gif>>
let a = ["0", "1", "0", "1", "0", "1", "0", "0", "0", "0", "0", "0", "0", "0", "1", "0", "1", "0", "0", "0", "0", "1", "0", "1", "0", "0", "1", "0", "0", "0", "1", "0", "1", "0", "0", "0", "1", "0", "1", "0", "1", "0", "1", "0", "0", "0", "1", "0", "0", "0", "0", "0", "1", "0", "1", "0", "1", "0", "0", "1", "0", "1", "0", "1", "0", "0", "1", "0", "0", "0", "0", "1", "0", "0", "1", "0", "0", "0", "1", "0", "0", "1", "0", "1", "0"]
@listiani13
listiani13 / a.js
Last active August 28, 2019 08:42
let a = [0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0]
@listiani13
listiani13 / pug.gif
Last active September 20, 2020 04:54
pug.gif
@listiani13
listiani13 / types.ts
Last active March 15, 2022 06:26
Workaround for react-navigation linking configuration typing issue
import { NavigatorScreenParams } from '@react-navigation/native';
import { Screen } from './screens';
export declare type PathConfigWrapped<ParamList extends unknown> = {
path?: string;
exact?: boolean;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
parse?: Record<string, (value: string) => any>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@listiani13
listiani13 / custom-jest-expo-preset.ts
Created March 28, 2022 04:23
Custom jest-expo to use original promise in react-native
// eslint-disable-next-line @typescript-eslint/no-var-requires
const reactNativePreset = require('jest-expo/jest-preset');
module.exports = {
...reactNativePreset,
// This line is fix warning for `act` caused by jest using mock Promise in react-native setup files
// The backstory is we need to use `waitFor` each time we do `fireEvent.changeText` because Formik is doing async validation on blur events
// Here we need to override global.Promise in react-native's jest preset to use actual Promise
// https://stackoverflow.com/a/66858310/9079265
setupFiles: [require.resolve('../save-promise.js')]