Skip to content

Instantly share code, notes, and snippets.

View Danielapariona's full-sized avatar
🏠
Working from home

Daniela Pariona Coronado Danielapariona

🏠
Working from home
View GitHub Profile
@jnizet
jnizet / confirm-modal-and-service.ts
Last active October 27, 2022 16:54
How to create a reusable service allowing to open a confirmation modal from anywhere with ng-bootstrap
import { Component, Injectable, Directive, TemplateRef } from '@angular/core';
import { NgbModal, NgbModalRef, NgbModalOptions } from '@ng-bootstrap/ng-bootstrap';
/**
* Options passed when opening a confirmation modal
*/
interface ConfirmOptions {
/**
* The title of the confirmation modal
*/
@kmaida
kmaida / formUtils.factory.ts
Last active August 21, 2020 14:06
Angular Date Validator - directive and factory - validates strings m/d/yyyy
// MM/DD/YYYY, M/D/YYYY
const DATE_REGEX = new RegExp(/^(\d{2}|\d{1})\/(\d{2}|\d{1})\/\d{4}$/);
export { DATE_REGEX };
@SanderTheDragon
SanderTheDragon / postman-deb.sh
Last active July 25, 2024 08:22
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
# SPDX-FileCopyrightText: 2017-2024 SanderTheDragon <sanderthedragon@zoho.com>
#
# SPDX-License-Identifier: MIT
arch=$(dpkg --print-architecture)
echo "Detected architecture: $arch"
case "$arch" in
@joalbertg
joalbertg / web-servers.md
Created January 3, 2018 20:00 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@joalbertg
joalbertg / nodelist-iteration.js
Created February 6, 2018 15:38
Iterar un nodeList
let elements = document.querySelectorAll('div'),
callback = (el) => { console.log(el); };
// Spread operator
[...elements].forEach(callback);
// Array.from()
Array.from(elements).forEach(callback);
// for...of statement