Skip to content

Instantly share code, notes, and snippets.

View jonathanarbely's full-sized avatar
🐺
Always looking for challenging and cool projects!

Jonathan Arbely jonathanarbely

🐺
Always looking for challenging and cool projects!
View GitHub Profile
@jonathanarbely
jonathanarbely / difference-between-dates.js
Created January 16, 2020 02:11 — forked from DavidWells/difference-between-dates.js
Get difference between two dates. Number of seconds, minutes, hours and days between two unix timestamps.
var unixTimeBetween = function(d1, d2) {
var today = d2.getTime() / 1000
var diff = Math.abs(d1 - (d2.getTime() / 1000));
var result = diff / (60 * 60 * 24);
console.log('Result: ' + result);
if(result * 24 * 60 * 60 < 60)
console.log('Seconds ago: ' + Math.trunc(result * 24 * 60 * 60));
else if(result * 24 * 60 < 60)
@jonathanarbely
jonathanarbely / app.component.ts
Created June 2, 2019 21:18
Ionic 4 - White Status (Signal) Bar Color
// Use Case: When working with dark colors in your app's header section, the default black color of the iOS native signal/status bar can create a disturbing and hard to read appereance. Changing this to white gives the app a more user-friendly tone.
// Todo: In your app.component.ts you will find the following funtion inside of 'export class xyz'...
initializeApp() {
this.platform.ready().then(() => {
// ...change this line and add '.styleLightContent()' at the end instead of 'this.statusBar.styleDefault()'
this.statusBar.styleLightContent();
});
}
@jonathanarbely
jonathanarbely / _stepper.pug
Last active April 11, 2018 06:42
Pug Mixin Example
// _stepper.pug
mixin stepper(title, name, val, inactive)
p.c-hitlist__label= title
if inactive
.stepper__wrapper.disabled__wrapper(id=name+'Stepper')
// Decrease value (disabled/default)
button.stepper__dec(type='button', disabled)
img(src=IMG_pfad+'icons/ih-iconset/minus-676767.svg')
// Textinput for direct value-manipulation (inactive + predefined value/default)
if val
@jonathanarbely
jonathanarbely / unslider.calcslides.js
Created January 12, 2018 10:45
unslider.js from release v.2.0.3 (1e6558f) - Contains a critical bugfix in the calculateSlides function
// unslider.js from release v.2.0.3 (1e6558f) - Contains a critical bugfix, PR pending
// See this issue for more info on this custom version: https://github.com/idiot/unslider/issues/511
/**
* Unslider
* version 2.0
* by @idiot and friends
*/
(function($) {
@jonathanarbely
jonathanarbely / shareviamessenger.html
Created November 18, 2017 19:04
Sharing for Messenger - Simple & no Tracking
<a href="fb-messenger://share/?link=https://www.interhome.at" title="Share on Messenger" onclick="window.open('fb-messenger://share/?link=' + document.URL ); return false;"></a>