Skip to content

Instantly share code, notes, and snippets.

View cyrildewit's full-sized avatar
💻

Cyril de Wit cyrildewit

💻
View GitHub Profile
@cseeman
cseeman / markdown_examples.md
Last active April 21, 2025 13:40
Markdown for info panel/warning box

Examples for how to create your own info panel, warning box and other decent looking notification in GitHub markdown.

All the boxes are single/two cell tables or two row tables.

Warning box

❗ You have to read about this
@dannberg
dannberg / obsidian-people-template.txt
Last active April 11, 2025 07:39
Dann Berg's People Template for Obsidian. Uses Dataview & Templater plugins. Should be saved as a Markdown file in Obsidian. See full tutorial for setup instructions: https://dannb.org/blog/2022/obsidian-people-note-template/
---
company:
location:
title:
email:
website:
aliases:
---
tags:: [[👥 People MOC]]
@alexkates
alexkates / how-to-trigger-lambda-from-sqs-stack.ts
Last active January 11, 2025 00:53
How to Trigger an AWS Lambda from SQS using the AWS CDK
// Import aws-cdk packages
import * as cdk from '@aws-cdk/core';
import * as sqs from '@aws-cdk/aws-sqs';
import * as lambda from '@aws-cdk/aws-lambda';
import * as lambdaEventSources from '@aws-cdk/aws-lambda-event-sources';
export class HowToTriggerLambdaFromSqsStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
export default function(originalPromise, delay = 750) {
return Promise.all([
originalPromise,
new Promise(resolve => {
setTimeout(() => resolve(), delay)
}),
]).then(result => result[0])
}
// Usage
@itsprofcjs
itsprofcjs / fetch with retry and backoff
Last active November 3, 2024 01:36
Rxjs http fetch call with retry and backoff feature
import { fromFetch } from 'rxjs/fetch';
import { catchError, delay, mergeMap, retryWhen, switchMap } from 'rxjs/operators';
import { from, Observable, of, throwError } from 'rxjs';
const retryWithBackOff = (delayMs: number = 0, maxRetry: number = 0, backOffMs: number = 0) => {
let currentRetries = maxRetry;
return (source: Observable<any>) =>
source.pipe(
retryWhen((error: Observable<any>) =>
@danieldogeanu
danieldogeanu / RenameGitBranch.md
Last active March 1, 2025 12:41
How to rename your Git master branch to main.

To rename your Git master branch to main, you must do the following steps:

  1. Navigate to your repository in the command line and issue the following commands: - git branch -m master main - git push -u origin main

  2. Change your default branch on GitHub by going to your GitHub repository in your browser, and navigate to Settings > Branches and click on the dropdown and switch from master to main and click Update (this will only show if you have two or more branches). The main branch is now your default branch.

  3. Update the tracking of the branch from your command line with the following command: - git branch -u origin/main main

@Potherca
Potherca / README.md
Last active June 17, 2020 09:51
List of kick-ass developers to follow based in the Netherlands
@ericlbarnes
ericlbarnes / PewPewPew.php
Created May 7, 2020 15:12
Hold up... Wait a minute... It's a Laravel Chopper
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class PewPewPew extends Command
{
protected $signature = 'pewpewpew';
protected $description = 'Command description';
@bubba-h57
bubba-h57 / phpunit.yml
Created April 29, 2020 19:37
Github Actions Continuous Integration/Testing workflow for PHP 7.4, Laravel 7, MariaDb, & Redis.
name: Laravel 7, MariaDb, & Redis CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
continuous-integration:
@Miguel-Serejo
Miguel-Serejo / benchmark.php
Created December 27, 2019 17:23
Benchmarking different startsWith strategies
<?php
$providers = [
'Illuminate\Auth\AuthServiceProvider',
'Illuminate\Broadcasting\BroadcastServiceProvider',
'Illuminate\Bus\BusServiceProvider',
'Illuminate\Cache\CacheServiceProvider',
'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
'Illuminate\Cookie\CookieServiceProvider',
'Illuminate\Database\DatabaseServiceProvider',
'Illuminate\Encryption\EncryptionServiceProvider',