Skip to content

Instantly share code, notes, and snippets.

View guillefd's full-sized avatar

Guillermo guillefd

View GitHub Profile
julianpoemp /
Last active November 11, 2023 19:06
Optimal .htaccess configuration for Angular 15, Angular 14, Angular 13, Angular 12, Angular 11, Angular 10, Angular 9, Angular 8, Angular 7, Angular 6, Angular 5 (and older) app in production incl. fix for the angular browser caching issue.

New generator

I created a new htaccess generator for angular apps that makes it easier for you to create the optimal htaccess file:

The goal of this generator is to create the optimal .htaccess file for Angular apps easily. By default the generator creates an .htaccess file that solves the route redirection issue. To make it easier for you I created a kind of interview mode with some questions. As an additional feature the generator supports adding exclusions for example if you have installed a blog in a subdirectory of your web application and more!

The generator 😁:

The project:

wesbos / async-await.js
Created February 22, 2017 14:02
Simple Async/Await Example
View async-await.js
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
bekce /
Created February 13, 2017 11:46
Node.js IMAP client with parsing

This example connects to an imap server and retrieves emails

npm install imap mailparser

btroncone /
Last active July 16, 2023 14:57
RxJS 5 Operators By Example
pisculichi / radios_nacionales.txt
Last active December 7, 2023 23:53
URLs de radios nacionales de Argentina, para poder escuchar en la terminal con mplayer o vlc
View radios_nacionales.txt
# alias radio='function __radio(){ r=`grep -v "#" radios_nacionales.txt | grep -m 1 -i $1 | cut -d" " -f1`; cvlc $r 2> /dev/null; }; __radio'
# podria utilizarse mplayer en vez de vlc
AMs Nacionales Radio Madre 530; Radio Colonia 550 Radio Argentina 570 Continental 590 Rivadavia 630
danharper / CatchAllOptionsRequestsProvider.php
Last active May 23, 2022 04:03
Lumen with CORS and OPTIONS requests
View CatchAllOptionsRequestsProvider.php
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
* If the incoming request is an OPTIONS request
* we will register a handler for the requested route
class CatchAllOptionsRequestsProvider extends ServiceProvider {
codeguy / slugify.js
Created September 24, 2013 13:19
Create slug from string in Javascript
View slugify.js
function string_to_slug (str) {
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
var to = "aaaaeeeeiiiioooouuuunc------";
for (var i=0, l=from.length ; i<l ; i++) {
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));