Skip to content

Instantly share code, notes, and snippets.

View andresgcarmona's full-sized avatar
🎯
Focusing

Andrés G. Carmona andresgcarmona

🎯
Focusing
View GitHub Profile
@leemartin
leemartin / ProgressCircle.vue
Created March 24, 2024 15:40
A progress circle Vue component powered by CSS conic gradient
<template>
<div class="h-full rounded-full w-full" :style="conicGradient"></div>
</template>
<script setup>
// Props
const props = defineProps({
color: {
type: String,
default: '#000000'
@kfox
kfox / README.md
Last active December 4, 2023 11:08
TCP echo server for Node.js

TCP echo server for Node.js

Usage

  1. Make sure you have a modern-ish version of Node.js installed.
  2. Type npx https://gist.github.com/kfox/1280c2f0ee8324067dba15300e0f2fd3
  3. Connect to it from a client, e.g. netcat or similar: nc localhost 9000
// code updates are now there:
// https://github.com/Bleuje/processing-animations-code/blob/main/code/hilbertcurvetransforms/hilbertcurvetransforms.pde
// Processing code by Etienne JACOB
// motion blur template by beesandbombs
// CC BY-SA 3.0 license because it's using code from Wikipedia
// View the rendered result at: https://bleuje.com/gifanimationsite/single/hilbertcurvetransforms/
int[][] result;
float t, c;
@jjimenezshaw
jjimenezshaw / mandelbrot.cpp
Created August 12, 2021 13:44
Mandelbrot Set in asciiart in 15 lines
#include <complex>
#include <iostream>
int main() {
const size_t limit = 1000, size = 400; // change 'size' to make it more detailed
const char letters[] = " 123456789abcdefghijklmnopqrstuvwxyz*";
for (size_t iy = 0; iy <= size; iy++) {
for (size_t ix = 0, count = 0; ix <= size; ix++, count = 0) {
std::complex<double> c(-2.0+ix*2.5/size, 1.15-iy*2.3/size), z(0.0, 0.0);
while (std::norm(z) < 4.0 && count++ < limit) z = z*z+c;
std::cout << ((count >= limit) ? letters[0] : letters[std::min(count, sizeof(letters)-2)]);
@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=
@leemartin
leemartin / spotify-waveform.js
Last active May 24, 2024 16:23
Spotify Waveform Data Generation from Audio Analysis API
const fs = require('fs')
const data = require('./track.json')
let duration = data.track.duration
let segments = data.segments.map(segment => {
return {
start: segment.start / duration,
duration: segment.duration / duration,
loudness: 1 - (Math.min(Math.max(segment.loudness_max, -35), 0) / -35)
Title:
Incident date:
Owner:
Peer-review committee:
Tags:
Summary:
Supporting data:
Customer Impact:
Incident Response Analysis:
Post-Incident Analysis:
@kentcdodds
kentcdodds / package.json
Last active April 30, 2024 05:39
setup script for my workshops
{
"name": "workshop-setup",
"version": "1.0.0",
"description": "This is the common setup script for most of my workshops",
"bin": "./setup.js"
}
@iamsajidjaved
iamsajidjaved / AppServiceProvider.php
Created December 12, 2019 07:04 — forked from simonhamp/AppServiceProvider.php
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@leemartin
leemartin / create-spotify-playlist-with-artwork.js
Last active May 24, 2024 16:24
Create Spotify Playlist with Artwork
// initialize axios instance
let spotify = axios.create({
baseURL: 'https://api.spotify.com',
headers: {
'Authorization': `Bearer ${token}`
}
})
// get user id for playlist creation
spotify.get('/v1/me').then(res => {