Skip to content

Instantly share code, notes, and snippets.

View predorock's full-sized avatar
🎯
Focusing

Marco predorock

🎯
Focusing
View GitHub Profile
@predorock
predorock / firestore-datepicker-adapter.directive.ts
Last active December 16, 2023 03:27
Firestore Timestamp to Angular Material Datepicker date
import { Directive, HostListener } from '@angular/core';
import { NgModel } from '@angular/forms';
import * as firebase from 'firebase';
@Directive({
selector: '[appFirestoreDatepickerAdapter]',
providers: [NgModel],
})
export class FirestoreDatepickerAdapterDirective {
const gulp = require('gulp');
const csv = require('csv-parser');
const fs = require('fs');
const _ = require('lodash');
const paths = {
translations: {
input: [
'./translations/medics_translations.csv',
@predorock
predorock / replace-imports.txt
Last active September 5, 2022 09:22
RegEx to replace relative imports to absolute imports in vscode
// pseudo code
const alias = 'environment'
(?<=from)((?!\'\.\/).)*?(?=alias)
or
(\.\.\/)+(?=alias)
//NOTE: I'am working with an angular cli project. So do the refactoring module by module in case you have to fix some issues due to import replacement
import socket
import fcntl
import struct
import pyupm_i2clcd as lcd
def get_ip_address(ifname):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
return socket.inet_ntoa(fcntl.ioctl(
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;