Skip to content

Instantly share code, notes, and snippets.

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

Angel D. Munoz AngelMunoz

🏠
Working from home
View GitHub Profile
@AngelMunoz
AngelMunoz / read-write.js
Created September 22, 2016 03:59
leeer y escribir archivos en nodejs con node v6.0+
// importamos la libreria
const fs = require('fs');
//puede llevar cualquier nombre, generalmente
// se sigue la convencion de usar el mismo nombre que la libreria
// fs es parte de la libreria estandard
/**
* @param {string} directorio de destino
* @param {string} texto a escribir dentro del archivo
@AngelMunoz
AngelMunoz / log.js
Created February 19, 2017 09:04
add a file logger in sails.js
const winston = require('winston')
const customLogger = new (winston.Logger)({
transports: [
new (winston.transports.Console)({
colorize: true,
level: 'silly',
json: false
}),
new (winston.transports.File)({ // add as many as you want
name: 'verbose-file',
/**
Let say I have a fancy class with some fancy methods in services|helpers
withoud any sails logic in it, eg no waterline, no sails.*.*.js
*/
class FancyService {
async fancyMethod() {
return await Promise.resolve('Fancy Result')
}
}
@AngelMunoz
AngelMunoz / UwpMediaToolbar.vue
Created June 19, 2018 16:56
A sample using a Vue component of a small media toolbar
<template>
<v-toolbar dark>
<v-btn icon @click="pickAudio">
<v-icon>library_music</v-icon>
</v-btn>
<v-btn icon v-if="file.isAvailable && !isPlaying" @click="play">
<v-icon>play_arrow</v-icon>
</v-btn>
<v-btn icon v-else-if="file.isAvailable && isPlaying" @click="pause">
<v-icon>pause</v-icon>
@AngelMunoz
AngelMunoz / app.html
Last active December 31, 2018 02:36
Aurelia Gist
<template>
<require from="./event-case"></require>
<h1>${message}</h1>
<p>
Looking at the console, you can see the event was dispatched,
but it was not caught by aurelia's binding <br />
<event-case ref="case1" my-click.trigger="onClick($event)"></event-case>
<event-case ref="case2" my-click.delegate="onClick($event)"></event-case>
</p>
<p>
@AngelMunoz
AngelMunoz / read-write.js
Created September 22, 2016 03:59
leeer y escribir archivos en nodejs con node v6.0+
// importamos la libreria
const fs = require('fs');
//puede llevar cualquier nombre, generalmente
// se sigue la convencion de usar el mismo nombre que la libreria
// fs es parte de la libreria estandard
/**
* @param {string} directorio de destino
* @param {string} texto a escribir dentro del archivo
@AngelMunoz
AngelMunoz / stuff i need to install in every format.md
Last active September 26, 2019 00:30
These are some programs I need to install any time I format my pc, I tend to forget them so let's try to keep'em here

Cosas para instalar

Nombre Windows Linux
nvm https://github.com/coreybutler/nvm-windows/releases https://github.com/creationix/nvm
node (con nvm) nvm install (numero de la ultima version) nvm install --lts
npm i -g typescript tslint eslint bower grunt-cli gulp-cli aurelia-cli firebase-tools npm i -g typescript tslint eslint bower grunt-cli gulp-cli aurelia-cli firebase-tools npm i -g typescript tslint eslint bower grunt-cli gulp-cli aurelia-cli firebase-tools
docker https://store.docker.com/editions/community/docker-ce-desktop-windows https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04
Git https://git-scm.com/download/win sudo apt install git
vscde https://code.visualstudio.com/ https://code.visualstudio.com/
@AngelMunoz
AngelMunoz / main.ts
Created December 3, 2019 02:13
aurelia-stencil-ionic sample
/// <reference types="aurelia-loader-webpack/src/webpack-hot-interface"/>
import { Aurelia } from 'aurelia-framework'
import environment from './environment';
import { PLATFORM } from 'aurelia-pal';
import { defineCustomElements } from '@ionic/core/loader';
import { defineCustomElements as defineShared } from '@project/shared/dist/loader';
import '@ionic/core';
import { setupConfig } from '@ionic/core';
import authConfig from 'auth.config';
@AngelMunoz
AngelMunoz / main.ts
Created December 3, 2019 02:13
aurelia-stencil-ionic sample
/// <reference types="aurelia-loader-webpack/src/webpack-hot-interface"/>
import { Aurelia } from 'aurelia-framework'
import environment from './environment';
import { PLATFORM } from 'aurelia-pal';
import { defineCustomElements } from '@ionic/core/loader';
import { defineCustomElements as defineShared } from '@project/shared/dist/loader';
import '@ionic/core';
import { setupConfig } from '@ionic/core';
import authConfig from 'auth.config';
@AngelMunoz
AngelMunoz / Unsplash.fs
Created February 4, 2020 15:48
Use F# Type Providers with the unsplash API
module Unsplash
open FSharp.Data
open System.IO
open System.Net.Http
type RandomPhoto =
JsonProvider<"https://api.unsplash.com/photos/random?client_id=<YOUR ACCESS TOKEN>">
let getRandomPhoto = RandomPhoto.AsyncGetSample()