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 => {
@ConnerWill
ConnerWill / ANSI-escape-sequences.md
Last active December 27, 2024 03:42
ANSI Escape Sequences cheatsheet

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@tatsuyasusukida
tatsuyasusukida / !README-javascript-svg-png.md
Last active October 4, 2024 19:04
🌅 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 August 16, 2024 08:25
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 ....*/