Skip to content

Instantly share code, notes, and snippets.

View catalinmiron's full-sized avatar
🎥
https://www.youtube.com/c/catalinmirondev

Catalin Miron catalinmiron

🎥
https://www.youtube.com/c/catalinmirondev
View GitHub Profile
@steveruizok
steveruizok / sponsors.ts
Created November 19, 2021 13:38
A Next.js API route that will generate an image of your most recent 100 Github sponsors.
// pages/api/sponsors.ts
import { NextApiRequest, NextApiResponse } from 'next'
const AV_SIZE = 32
const PADDING = 4
const COLS = 16
type SponsorResult = { avatarUrl: string; login: string }
@steveruizok
steveruizok / usePublishCallback.ts
Created September 23, 2021 16:34
Croquet.io React Bindings (requires @croquet/react and @croquet/croquet)
import * as React from "react"
import { Model } from "@croquet/croquet"
import { CroquetContext } from "@croquet/react"
/**
* A callback that publishes the returned data to the current view's model.
* @param eventName The name of the event to be published.
* @param fn A function that returns the data to be published.
* @param deps (optional) An array of dependencies for the callback.
*/
@cawfree
cawfree / react-native-macos-catalyst.md
Last active July 17, 2023 10:09
How to use React Native and MacOS Catalyst

Follow these steps to run your React Native application using MacOS Catalyst.

  1. Use the following package versions:
+ "metro-react-native-babel-preset": "^0.59.0",
+ "react-native": "0.63.0",
+ "react-native-macos": "^0.63.23",
@eldadfux
eldadfux / .env
Last active June 29, 2022 05:24
Appwrite 0.14 - Stack
_APP_ENV=production
_APP_LOCALE=en
_APP_OPTIONS_ABUSE=enabled
_APP_OPTIONS_FORCE_HTTPS=disabled
_APP_OPENSSL_KEY_V1=your-secret-key
_APP_DOMAIN=localhost
_APP_DOMAIN_TARGET=localhost
_APP_CONSOLE_WHITELIST_ROOT=enabled
_APP_CONSOLE_WHITELIST_EMAILS=
_APP_CONSOLE_WHITELIST_IPS=
@sorcerykid
sorcerykid / stream.html
Created October 28, 2020 14:29
Apply effects to a live audio feed in JS
<audio crossorigin="anonymous" id="audio_source" controls preload="none" style="width:16em;padding:0;">
<source src="http://www.example.com:8000/sample?type=http&amp;nocache=4" type='audio/mpeg'>
</audio>
<script>
const AudioContext = window.AudioContext || window.webkitAudioContext;
const audio = document.querySelector( "audio" );
var convolverBuffer;
var convolverNode;
@ishan123456789
ishan123456789 / Providers.js
Created June 17, 2020 14:40
Fix for strapi to allow multiple providers
// /extensions/users-permissions
"use strict";
/**
* Module dependencies.
*/
// Public node modules.
const _ = require("lodash");
const request = require("request");
//
// YeetJSIUTils.h
// yeet
//
// Created by Jarred WSumner on 1/30/20.
// Copyright © 2020 Facebook. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <jsi/jsi.h>
@derekstavis
derekstavis / FastList.tsx
Last active May 13, 2025 05:45 — forked from vishnevskiy/FastList.js
Discord's FastList, but in TypeScript
import { forEachObjIndexed } from "ramda";
import * as React from "react";
import {
Animated,
ScrollView,
View,
ViewStyle,
LayoutChangeEvent,
NativeScrollEvent,
} from "react-native";
@ruzickap
ruzickap / git-repository-gpg-crypt
Created November 1, 2019 15:54
Make git repository encrypted with generated GPG key which can be used by CI/CD to access the git repo when using GitHub Actions
# Make sure you are using gpg2
git config --global gpg.program gpg2
# Clone empty repository
git clone [email protected]:ruzickap/terraform-gitops.git
# Configure a repository to use git-crypt
cd terraform-gitops
git-crypt init
@brennanMKE
brennanMKE / SilentAudioFile.m
Created October 30, 2017 17:23
Create a silent audio file with Objective-C
- (void)createSilentAudioFileAtURL:(NSURL *)fileURL durationInMilliseconds:(NSInteger)durationInMilliseconds {
AudioFileID mRecordFile;
AudioStreamBasicDescription audioFormat;
audioFormat.mSampleRate = 44100.00;
audioFormat.mFormatID = kAudioFormatLinearPCM;
audioFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked;
audioFormat.mFramesPerPacket = 1;
audioFormat.mChannelsPerFrame = 2;
audioFormat.mBitsPerChannel = sizeof(short) * 8;