Skip to content

Instantly share code, notes, and snippets.

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

Dale Ryan lnfel

🏠
Working from home
View GitHub Profile
@andrew8088
andrew8088 / mapPromises.js
Created February 15, 2024 14:56
Managing Promise Concurrency in JavaScript
function mapPromises(args, callback, concurrency = 3) {
const { promise, resolve } = Promise.withResolvers();
const results = [];
let cursor = 0;
function next() {
if (cursor < args.length) {
const index = cursor++;
void callback(...args[index]).then(value => {
@tatsuyasusukida
tatsuyasusukida / !README-javascript-svg-png.md
Last active April 30, 2024 06:11
🌅 How to convert SVG to PNG with JavaScript [video version available]

🌅 How to convert SVG to PNG with JavaScript [video version available]

Video thumbnail: How to convert SVG to PNG with JavaScript

About this article

This article describes how to convert SVG to PNG with frontend JavaScript. The related resources are as follows.

<?php
namespace App\Providers;
use App\Services\PaginationService;
use Illuminate\Support\Collection;
use Illuminate\Support\ServiceProvider;
class CollectionMacroServiceProvider extends ServiceProvider
{
this video was created earlier in january from a stupid idea and was driven by sheer determination
despite lacking programming skill. here's a decent description of how it was made (because i am
too lazy to write a github readme):
1. the video
i downloaded the pv off youtube and used ffmpeg to resize it down to 70x54 dimensions (for easy
math calculations, i used 27 firefox windows, 7 tabs each, so it divided nicely). i then used
ffmpeg (again) to splice the source video into 15-second segments to reduce desyncing and cpu load.
2. the frames
@simo54
simo54 / README.md
Last active January 28, 2024 17:56
Change default path on Ubuntu Terminal 20.04 LTS

Steps for changing the default path

  1. Open the terminal

  2. Digit the following line and press Enter once done

    echo "cd YOURPERSONALSTANDARDPATH" >> ~/.bashrc
    
@pixleight
pixleight / carousel.css
Created December 8, 2020 17:13
Tailwind CSS / Alpine.js Image Carousel with Lightbox
@kesor
kesor / component-app.js
Last active April 23, 2024 15:18
Vue.js 3.x with ES6 modules in the browser using import-map
import { defineAsyncComponent } from 'vue'
const Content = defineAsyncComponent(() => import('./component-content.js'))
export default {
name: 'App',
components: { Content },
template: /*html*/`
<Content />
`
@mithicher
mithicher / pikaday-dark.css
Created May 22, 2020 14:14
Pikaday Theme - Dark version
.pikaday-dark {
--backgroundColor: #2d3748;
--textColor: #f7fafc;
--currentDateTextColor: #3182ce;
--selectedDateBackgroundColor: #3182ce;
--selectedDateTextColor: #f7fafc;
--labelTextColor: #3182ce; /* eg. May 2020 */
--weekDaysTextColor: #a0aec0; /* eg. Mo Tu We ....*/
@mithicher
mithicher / pikaday-white.css
Created May 22, 2020 14:10
Pikaday Theme - White version
.pikaday-white {
--backgroundColor: #ffffff;
--textColor: #718096;
--currentDateTextColor: #3182ce;
--selectedDateBackgroundColor: #3182ce;
--selectedDateTextColor: #ffffff;
--labelTextColor: #4a5568; /* eg. May 2020 */
--weekDaysTextColor: #a0aec0; /* eg. Mo Tu We ....*/
@fnky
fnky / stripe-keys-and-ids.tsv
Last active May 5, 2024 19:31
Stripe keys and IDs
Prefix Description Notes
ac_ Platform Client ID Identifier for an auth code/client id.
acct_ Account ID Identifier for an Account object.
aliacc_ Alipay Account ID Identifier for an Alipay account.
ba_ Bank Account ID Identifier for a Bank Account object.
btok_ Bank Token ID Identifier for a Bank Token object.
card_ Card ID Identifier for a Card object.
cbtxn_ Customer Balance Transaction ID Identifier for a Customer Balance Transaction object.
ch_ Charge ID Identifier for a Charge object.
cn_ Credit Note ID Identifier for a Credit Note object.