Skip to content

Instantly share code, notes, and snippets.

View hiddenboox's full-sized avatar
🎯
Focusing

Sebastian Sobociński hiddenboox

🎯
Focusing
View GitHub Profile
@NigelEarle
NigelEarle / Knex-Migrations-Seeding.md
Last active February 17, 2025 18:17
Migration and seeding instructions using Knex.js!

Migrations & Seeding

What are migrations??

Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex command line tool.

To learn more about migrations, check out this article on the different types of database migrations!

Creating/Dropping Tables

@dungdm93
dungdm93 / android-gradle.yml
Last active January 26, 2024 06:49
GitLab-CI: Caching by package manager
variables:
ANDROID_COMPILE_SDK: "28"
test:unit:
image: circleci/android:api-${ANDROID_COMPILE_SDK}
cache:
key: gradle-cache
paths: [ .gradle ]
variables:
# GRADLE_OPTS: "-Dorg.gradle.daemon=false"
const compose = (fn, ...funcs) => {
return (...args) => {
return funcs.reduce((acc, func) => func(acc), fn(...args))
}
}
const generate = (fn, dependency = LazyIterable, descriptor) => {
return Object.create(
Object.assign({ [Symbol.iterator]: fn }, dependency),
descriptor
@reillyeon
reillyeon / async_function_return.md
Last active February 22, 2022 16:05
When does an async function return?

When does an async function return?

Someone recently asked me when an async function in JavaScript "returns". This is an interesting question because while a function like f() below has a return statement in it, f() actually returns much earlier than that. To understand how this works, let's take a look at an example function. Here, a() and c() are normal synchronous functions and b() is another asynchronous function.

async function f() {
  a();
  await b();
  return c();
}
import * as SecureStore from 'expo-secure-store';
import { chunk } from 'lodash';
const chunkString = (str: string, size: number) =>
chunk(str.split(''), size).map(s => s.join(''));
/**
* Secure Storage with support for storing strings larger than 2048 characters
*/
const ExpoSecureStoreAdapter = {