Skip to content

Instantly share code, notes, and snippets.

View sonnylazuardi's full-sized avatar
🎯
Focusing

Sonny Lazuardi sonnylazuardi

🎯
Focusing
View GitHub Profile
@Wolfr
Wolfr / framer-x-with-css.tsx
Created August 24, 2018 18:44
Using CSS in Framer X component
// Here is a basic Framer X component where we use CSS directly
import * as React from "react";
import { PropertyControls, ControlType } from "framer";
// Define type of property
interface Props {
width: number
height: number
}
@jamesmcallister
jamesmcallister / iframePage.html
Created August 4, 2018 13:04
eval js code in an iframe
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
@joeytwiddle
joeytwiddle / async-await-forEach-alternatives.md
Last active September 12, 2025 19:54
Do not use forEach with async-await

Do not use forEach with async-await

TLDR: Use for...of instead of forEach() in asynchronous code.

For legacy browsers, use for(...;...;...) or [].reduce()

To execute the promises in parallel, use Promise.all([].map(...))

The problem

@ivanlanin
ivanlanin / kata.dat
Last active May 17, 2023 13:57
Daftar kata yang sering salah dieja dengan tiap baris terdiri atas ejaan yang benar lebih dahulu dan diikuti variannya
Benar Salah
Allah Alloh
Alquran Al Qur'an
Alquran Al-Qur'an
Alquran Al-Quran
Asar Azhar
Buddha Buda
Buddha Budha
Februari February
Februari Pebruari
@atinux
atinux / async-foreach.js
Last active April 2, 2025 11:34
JavaScript: async/await with forEach()
const waitFor = (ms) => new Promise(r => setTimeout(r, ms))
const asyncForEach = async (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array)
}
}
const start = async () => {
await asyncForEach([1, 2, 3], async (num) => {
await waitFor(50)
@gregblass
gregblass / App.js
Last active September 21, 2019 17:30
Expo/React Navigation - Google Analytics Integration
import React, { Component } from 'react'
import { RootNavigator } from './navigators'
import { GoogleAnalyticsTracker } from './utils/analytics'
import { GA_TRACKING_ID } from './constants'
class App extends Component {
// gets the current screen from navigation state
getCurrentRouteName = (navigationState) => {
if (!navigationState) {
return null
@Yawenina
Yawenina / debounce-lodash.js
Last active May 7, 2024 09:44
lodash debounce and throttle source code
const nativeMax = Math.max;
const nativeMin = Math.min;
function debounce(func, wait, options) {
let lastArgs,
lastThis,
maxWait,
result,
timerId,
lastCallTime,
lastInvokeTime = 0,
104.16.119.221 boards.4chan.org
104.16.59.249 i.4cdn.org
@int128
int128 / README.md
Last active May 6, 2025 12:59
Watching build mode on Create React App

Create React App does not provide watching build mode oficially (#1070).

This script provides watching build mode for an external tool such as Chrome Extensions or Firebase app.

How to Use

Create a React app.

Put the script into scripts/watch.js.

@udezekene
udezekene / O'Reilly Design Books (Free).md
Last active June 15, 2025 14:09 — forked from augbog/Free O'Reilly Books.md
Download the just released O'Reilly Design Books for free without e-mail signup.

Free O'Reilly Design Books and convenient script to just download them.

HUGE thanks to O'Reilly for making this resource free. Visit the design page if you want to learn more about the design resources. Also, they do have FREE resources for other topics like: Data, IoT, Programming, Security, Web Development, and WebOps.

Thanks @augbog for the initial gist. If you are a developer or looking for software engineering books, headover to the source of this fork.

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)