Skip to content

Instantly share code, notes, and snippets.

View dlepaux's full-sized avatar
👾

David Lepaux dlepaux

👾
View GitHub Profile
@faustinoaq
faustinoaq / myAngular.html
Last active July 1, 2025 14:07
Front-end libraries (React, Vue, Angular) and the basic principles of how they work, all in a single file using pure JavaScript (VanillaJS).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Angular from Scratch</title>
<style>
.my-component {
font-family: Arial, sans-serif;
@louisgv
louisgv / mic-recorder.ts
Last active March 7, 2024 12:16
AudioWorklet replacement for ScriptProcessorNode
const main = async () => {
const context = new AudioContext();
const microphone = await navigator.mediaDevices
.getUserMedia({
audio: true
})
const source = context.createMediaStreamSource(microphone);
//https://habr.com/post/213515/
// This works on all devices/browsers, and uses IndexedDBShim as a final fallback
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB,
IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.msIDBTransaction,
baseName = "baseName",
storeName = "storeName";
function logerr(err){
console.log(err);
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yukoff
yukoff / GitHub Wiki Subtree Storage.markdown
Created September 3, 2017 13:01 — forked from jfexyz/GitHub Wiki Subtree Storage.markdown
Store and edit GitHub wikis within the main project repository.

Project documentation

The project documentation (stored in the docs directory) is a git subtree of the project wiki. This allows for the documentation to be referenced and edited from within the main project.

Initial local setup

When cloning the main project repository for the first time, the wiki repository must be added as a remote.

git remote add wiki https://github.com//.wiki.git

@anvk
anvk / promises_reduce.js
Last active September 8, 2024 15:10
Sequential execution of Promises using reduce()
function asyncFunc(e) {
return new Promise((resolve, reject) => {
setTimeout(() => resolve(e), e * 1000);
});
}
const arr = [1, 2, 3];
let final = [];
function workMyCollection(arr) {
@developit
developit / Mithril.js for React People.md
Last active August 13, 2018 09:52
Mithril.js for React People

Mithril.js for React People

This is a really basic "todo list" demo built with Mithril.

It's largely an ES6/ES2015 port of the Mithril's Getting Started guide, with a bit of sugar and opinion thrown in to make it look and feel a lot like React.

In this case we're using Babel's JSX transform to convert inline XML into hyperscript (just nested calls to Mithral's m() function).

A Pen by Jason Miller on CodePen.

@tdd
tdd / web-learning-and-watchind.md
Last active December 9, 2015 13:46
Quelques ressources pour faire sa veille technique et apprendre mieux autour du web

Lisez plutôt…

cet article détaillé que j'ai écrit ensuite…

Je laisse le Gist ici pour ne pas casser vos liens, mais bon 😄

Par e-mailing/RSS/etc.

Chaque jour ou chaque semaine :

@kostasx
kostasx / php2js-curl-basic-auth.js
Last active February 7, 2022 23:08
PHP to Node.js: cURL with Basic Authentication
/*
<?php
// THE FOLLOWING IMPLEMENTATION CAN BE USED FOR VARIOUS APIs. THIS WAS TESTED SUCCESSFULLY ON THE pingdom.com API
$email = "[email protected]";
$passwd = 'password';
$api_key = "API_KEY";
$curl = curl_init();
@ChubV
ChubV / TwigExtensionTestCase.php
Created July 10, 2013 08:57
Twig extension test case
<?php
namespace ChubProduction\Bundle\XXXBundle\Tests;
/**
* TwigExtensionTestCase
*
* @author Vladimir Chub <[email protected]>
*/
trait TwigExtensionTestCase
{