Skip to content

Instantly share code, notes, and snippets.

@ejke
ejke / home.html
Created February 8, 2017 13:37
Ionic2 dynamically change links with ngFor
<ion-grid>
<ion-row>
<ion-col width-33 *ngFor="let info of infos">
<div class="instructions" [navPush]="info.tap">
<div>
<img src="assets/icons/{{info.icon}}.png" alt="Icon">
</div>
<span>{{info.title}}</span>
</div>
</ion-col>
@ejke
ejke / supply-second.html
Last active February 9, 2017 09:58
Ionic2: send data to subpages and sub-subpages
<ion-header>
<ion-navbar>
<ion-title *ngIf="selectedVarud">
{{selectedVarud.title}}</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<ion-list>
<ion-list-header class="list-header-margin">Jook</ion-list-header>
@ejke
ejke / css-mobile-first-0-600.css
Created April 12, 2017 15:27
WP admin bar + sticky header
.admin-bar .site-header {
top: 46px;
}
.admin-bar .site-header {
top: 46px;
}
@ejke
ejke / jquery.js
Created April 12, 2017 15:30
WP admin bar + sticky header js
var $document = $(document),
$header = $('.admin-bar .site-header');
if($(window).width() < 601) {
$document.scroll(function() {
if ($document.scrollTop() >= 46) {
// user scrolled 46 pixels or more;
$header.css({"top": "0"})
} else {
@ejke
ejke / css-mobile-first-783px-min.css
Created April 12, 2017 15:30
WP admin bar + sticky header query
@media screen and ( min-width: 783px ) {
.admin-bar .site-header {
top: 32px;
}
}
@ejke
ejke / jquery.js
Created April 13, 2017 10:21
Equalise li elements
//function to equalise li.person elemenets, no matter the content.
// Shorthand for $( document ).ready()
$(function() {
console.log( "ready! and equalise." );
var maxHeight = 0;
$("li").each(function(){
if ($(this).height() > maxHeight) { maxHeight = $(this).height(); }
});
$("li").height(maxHeight);
});
@ejke
ejke / js.js
Created December 1, 2017 12:27
Math random
// whole nr either 0,1,or 2
Math.floor((Math.random() * (3-0)));
// whole nr either 1,2 or 3
Math.floor((Math.random() * (3-0) + 1));
@ejke
ejke / functions.php
Created March 7, 2018 11:25
wp connect child parent css
<?php
function use_parent_theme_stylesheet() {
// Use the parent theme's stylesheet
return get_template_directory_uri() . '/style.css';
}
function my_theme_styles() {
$themeVersion = wp_get_theme()->get('Version');
// Enqueue our style.css with our own version
@ejke
ejke / git_aliases.txt
Last active June 11, 2021 11:28
Git Aliases to get yourself more time.
# Put the following into your ~/.bash_profile file (Mac) or ~/.bashrc file (Ubuntu)
# Enables to use shortcuts for most common git commands.
# ----------------------
# Git Aliases
# ----------------------
alias gf='git status'
alias gb='git branch'
alias gbn='git checkout'
alias gbnb='git checkout -b'