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 / inspect-music-properties.fsx
Last active June 6, 2020 05:00
Inspects the music properties of .mp3 files in the music directory
#r "nuget: Microsoft.Windows.Sdk.NET, 10.0.18362.3-preview"
open System
open Windows.Storage
let asyncGetFiles() =
async {
let! files = KnownFolders.MusicLibrary.GetFilesAsync().AsTask() |> Async.AwaitTask
return files |> Seq.take 5
}
@AngelMunoz
AngelMunoz / media-player.fsx
Last active June 6, 2020 12:19
uses the new #r "nuget: " directive coming in F# 5.0 plus the C#/WinRT projection to find at most 5 files from your music library and play them 100% natively on Windows 10
#r "nuget: Microsoft.Windows.Sdk.NET, 10.0.18362.3-preview"
open System
open Windows.Media
open Windows.Media.Core
open Windows.Media.Playback
open Windows.Storage
open Windows.Storage.FileProperties
@AngelMunoz
AngelMunoz / main.rs
Last active May 24, 2020 13:20
Small sample of the Rust/WinRT API projection https://github.com/microsoft/winrt-rs
winrt::import!(
dependencies
os
modules
"windows.foundation"
"windows.system.power"
);
use windows::system::power::*;
fn battery_status() -> std::string::String {
@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()
@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 / 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 / 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 / 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>