Skip to content

Instantly share code, notes, and snippets.

View jukbot's full-sized avatar
🏠
Working from home

Juk - a search builder jukbot

🏠
Working from home
  • CalCal
  • Bangkok, Thailand
  • X @jukbot
View GitHub Profile
@akexorcist
akexorcist / MaterialButtonGroup.kt
Last active October 26, 2021 18:05
Material Button Group for Material Button in Android
package com.akexorcist.materialdesign
import android.content.Context
import androidx.core.view.MarginLayoutParamsCompat
import androidx.core.view.ViewCompat
import android.util.AttributeSet
import android.util.Log
import android.view.View
import android.widget.LinearLayout
import com.google.android.material.shape.AbsoluteCornerSize
@rayriffy
rayriffy / popcat.js
Last active August 15, 2021 15:39
popcat.click clicker
// popcat auto-clicker
// by rayriffy
// drop this into DevTools console
// to run:
// let agent = clicker()
//
// to stop:
// agent.stop()
@roqbez
roqbez / import_excel.js
Created April 30, 2021 00:00
Node.js + Nest.js code to import Excel file to a database
import { HttpService, Injectable, Logger } from '@nestjs/common';
import { InjectModel } from '@nestjs/sequelize';
import { ReadStream } from 'fs';
import { Sequelize } from 'sequelize-typescript';
import * as xlsx from 'xlsx';
import { WorkBook, WorkSheet } from 'xlsx';
import { ArquivoImportacao } from './dto/arquivo-importacao.dto';
@Injectable()
export class ImportacaoProcessosService {
@sindresorhus
sindresorhus / esm-package.md
Last active November 15, 2024 15:20
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.
@prologic
prologic / LearnGoIn5mins.md
Last active November 5, 2024 02:14
Learn Go in ~5mins
@kcak11
kcak11 / App.md
Last active November 7, 2024 05:59
Country Codes

Country Codes

List of all Country Codes (ISO & Dialing) sorted in alphabetical order.

@leanazulyoro
leanazulyoro / server.js
Last active July 22, 2024 05:21
Next.js SSR Cache using LRU Cache
const express = require('express')
const next = require('next')
const Cache = require('lru-cache');
const compression = require('compression')
const port = parseInt(process.env.PORT, 10) || 3000
const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
@acoshift
acoshift / main.go
Last active March 3, 2020 06:20
http1 vs h2c
package main
import (
"context"
"crypto/tls"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
@puranjayjain
puranjayjain / DeleteFirestoreIndexes
Created February 10, 2020 09:23
Delete all firestore composite indexes
# Delete all firestore composite indexes
gcloud firestore indexes composite list --uri | xargs -I{} gcloud firestore indexes composite delete {} --quiet
import { ApolloClient, QueryOptions, MutationOptions } from 'apollo-client';
import { DocumentNode } from 'graphql';
import { getSdk, Requester } from '.generated/schema-typedefs';
import { ApolloRequestError } from './ApolloRequestError';
export type ApolloRequesterOptions<V, R> =
| Omit<QueryOptions<V>, 'variables' | 'query'>
| Omit<MutationOptions<R, V>, 'variables' | 'mutation'>;