Skip to content

Instantly share code, notes, and snippets.

View yoelnacho's full-sized avatar
:octocat:
working

Ignacio Arguello yoelnacho

:octocat:
working
View GitHub Profile
@yoelnacho
yoelnacho / moment.pipe.ts
Created July 16, 2017 21:35
moment pipe
import { Pipe, PipeTransform } from '@angular/core';
import moment from 'moment';
@Pipe({
name: 'moment'
})
export class MomentPipe implements PipeTransform {
transform(value: moment.Moment, format: string) {
if (!moment.isMoment(value))
@yoelnacho
yoelnacho / pipe.ts
Created July 13, 2017 01:13
variables en un string
path: string = "assets/images/";
let noimage = `${ path }no_avatar.svg`;
// Devuelve -> "assets/images/no_avatar.svg"
@yoelnacho
yoelnacho / home.html
Last active July 10, 2017 03:05
Http get de tareas y filtro por atributo "important"
<p><strong>Importantes: </strong><span *ngIf="postsFilter">{{ postsFilter.length }}</span></p>
<ion-list>
<ion-item no-padding *ngFor="let post of posts">
<!-- {{ post.description }} -->
<span *ngFor="let item of post.tags">#{{ item.name }} </span>
</ion-item>
</ion-list>
@yoelnacho
yoelnacho / artist.service.ts
Created April 2, 2017 22:38
Angular2: Service - simple get id
urlArtista:string = "https://api.spotify.com/v1/artists";
getArtista( id:string ){
let query = `/${ id }`;
let url = this.urlArtista + query;
return this.http.get( url )
.map( res =>{
console.log( res.json() );
@yoelnacho
yoelnacho / domseguro.pipe.ts
Created April 2, 2017 22:32
Angular2 Pipe: DOM seguro
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
@Pipe({
name: 'domseguro'
})
export class DomseguroPipe implements PipeTransform {
constructor( private domSanitizer:DomSanitizer ){ }
@yoelnacho
yoelnacho / artist.component.html
Last active July 13, 2017 01:04
Angular2 Pipe: Sin imagen
<img [src]="artist.images | sinfoto">
@yoelnacho
yoelnacho / animaciones.css
Created March 28, 2017 01:46
Animaciones para angular2 - pages
/* Animaciones */
.animated {
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
.fast {
-webkit-animation-duration: 0.3s;
@yoelnacho
yoelnacho / SassMeister-input.scss
Created March 11, 2017 13:37 — forked from jakob-e/SassMeister-input.scss
Generated by SassMeister.com.
// ----
// Sass (v3.4.0)
// Compass (v1.0.0)
// ----
// ===================================================================
// Compressesd mixins - just to save you from scrolling :)
// ===================================================================
$_current_breakpoint_key:'';@mixin media($breakpointkeys...){@each $key,$value in $breakpointkeys{$_current_breakpoint_key:$key!global;@media #{map-get($breakpoints,$key)}{@content}$_current_breakpoint_key:''!global}};@mixin extends(){@content;@each $key,$value in $breakpoints{@include media($key){@content}}}@mixin new-extend($name){%#{$_current_breakpoint_key+$name}{@content}}@mixin extend($name){&{@extend %#{$_current_breakpoint_key+$name}}}
@yoelnacho
yoelnacho / fix.js
Last active February 4, 2017 20:43
Fix - error iOS 10 pinch-to-zoom
document.documentElement.addEventListener('touchmove', function (event) {
event.preventDefault();
}, false);
@yoelnacho
yoelnacho / index.haml
Created January 21, 2015 15:14
mymQwW
%title
data-useragent
%h1
Si lo ves en color verde, estás en IE10.
%br
Si lo ves en color azul, estás en IE11.