Skip to content

Instantly share code, notes, and snippets.

View bipoza's full-sized avatar
📱

Bittor Poza bipoza

📱
View GitHub Profile
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-menu-button></ion-menu-button>
</ion-buttons>
<ion-title>
Demo
</ion-title>
</ion-toolbar>
</ion-header>
@bipoza
bipoza / textarea-autosize.directive.ts
Created January 2, 2020 11:40 — forked from kplhub/textarea-autosize.directive.ts
textarea autosize directive for ionic/angular 4 (updated to work with 4.0.0)
import { Directive, ElementRef, OnInit } from '@angular/core';
import { Observable, fromEvent } from 'rxjs';
import { DomController } from '@ionic/angular';
@Directive({
selector: 'ion-textarea[autosize]'
})
export class TextareaAutosizeDirective implements OnInit {
@bipoza
bipoza / Rendering hyperlinks from HTML strings in Ionic 4 and Angular
Created January 8, 2020 12:33
Rendering hyperlinks from HTML strings in Ionic 4 and Angular
@bipoza
bipoza / token.interceptor.ts
Created July 28, 2020 08:29 — forked from danielcrisp/token.interceptor.ts
TokenInterceptor - Async HTTP Interceptors with Angular 4
import { Injectable } from '@angular/core';
import { HttpErrorResponse, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/mergeMap';
import { AuthService } from './auth.service';
@Injectable()
export class TokenInterceptor implements HttpInterceptor {
@bipoza
bipoza / stop-video.js
Created September 9, 2020 14:26 — forked from cferdinandi/stop-video.js
A simple method to stop YouTube, Vimeo, and HTML5 videos from playing.
/**
* Stop an iframe or HTML5 <video> from playing
* @param {Element} element The element that contains the video
*/
var stopVideo = function ( element ) {
var iframe = element.querySelector( 'iframe');
var video = element.querySelector( 'video' );
if ( iframe ) {
var iframeSrc = iframe.src;
iframe.src = iframeSrc;
@bipoza
bipoza / wc-products-displayed-per-page.php
Created December 16, 2020 09:08 — forked from woogists/wc-products-displayed-per-page.php
[Theming Snippets] Change number of products displayed per page
/**
* Change number of products that are displayed per page (shop page)
*/
add_filter( 'loop_shop_per_page', 'new_loop_shop_per_page', 20 );
function new_loop_shop_per_page( $cols ) {
// $cols contains the current number of products per page based on the value stored on Options -> Reading
// Return the number of products you wanna show per page.
$cols = 9;
return $cols;
@bipoza
bipoza / iframe.html
Last active February 8, 2021 16:44
TinyMCE Custom button with Dialog openURL - Demo SOURCE: https://codesandbox.io/embed/tinymce-dialog-openurl-demo-fpfew
<p>Name: </p><input id="name" type="text"/>
<p>Select a Thing:</p>
<select name="thingselect" id="thingselect">
<option value="thing1">Thing 1</option>
<option value="thing2">Thing 2</option>
<option value="thing3">Thing 3</option>
</select>
<br>
@bipoza
bipoza / jeztaze.json
Last active November 18, 2021 08:17
Petilla Aragoi eta Jeztaze - OSM Geojson mugak
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
add_shortcode('wps_event_link', 'wps_event_link');
function wps_event_link() {
$post_id = '{{ post_data:ID }}';
}
@bipoza
bipoza / vscode_luzapenak.md
Last active May 31, 2021 14:57
VSCode - Kodea garbi mantentzeko luzapenak