Skip to content

Instantly share code, notes, and snippets.

Avatar
😃
fulfilled, like a resolved promise

Orlando Wenzinger Orlandster

😃
fulfilled, like a resolved promise
View GitHub Profile
View bootstrap grid breakpoints
< 768px = xs // @media (max-width : 767px) {}
≥ 768px = sm // @media (min-width : 768px) and (max-width : 991px) {}
≥ 992px = md // @media (min-width : 992px) and (max-width : 1199px) {}
≥ 1200px = lg // @media (min-width : 1200px) {}
View gist:6d9acf1b12c83882cf54cb75f3aaa52c
// by jfriend00 - https://stackoverflow.com/questions/46416433/how-to-resolve-a-promise-multiple-times
function getNotifier() {
const event = new Event('myEvent');
setTimeout(() => {
window.dispatchEvent(event);
}, 500);
setTimeout(() => {
@Orlandster
Orlandster / snippet.js
Last active Feb 23, 2018
requestAnimationFrame - Snippets
View snippet.js
// smooth to top scroll
(function smoothscroll(){
var currentScroll = document.documentElement.scrollTop || document.body.scrollTop;
if (currentScroll > 0) {
window.requestAnimationFrame(smoothscroll);
window.scrollTo (0,currentScroll - (currentScroll/5));
}
})();
// scroll event
View beaver-module-field-types.php
/* text */
'my-field-1' => array(
'type' => 'text',
'label' => __( 'Text Field 1', 'fl-builder' ),
),
/* textarea */
'my_textarea_field' => array(
'type' => 'textarea',
View gist:c1cf4975e4c7f766905b4d1bab5382b8
cd path/to/project-b
git remote add project-a path/to/project-a
git fetch project-a
git merge --allow-unrelated-histories project-a/master # or whichever branch you want to merge
git remote remove project-a
@Orlandster
Orlandster / gist:38b54962ba49e769add0b6330ca1d4dc
Created Jul 27, 2018
Git: merge branch from different repositories
View gist:38b54962ba49e769add0b6330ca1d4dc
mkdir joinSamples
cd joinSamples
git init
git remote add sample1 git.yourserver.local/sample1.git
git remote add sample2 git.yourserver.local/sample2.git
git fetch sample1
git fetch sample2
git branch sample1_master sample1/master
git branch sample2_master sample2/master
@Orlandster
Orlandster / gist:07e6771b04124c356d5e451b70a37634
Created Sep 13, 2018
Change content of Pseudo Element (::before, ::after) - ES6
View gist:07e6771b04124c356d5e451b70a37634
const setPseudoElContent = (selector, value) => {
document.styleSheets[0].addRule(selector, `content: "${value}";`);
}
setPseudoElContent('.class::after', 'Hello World!');
@Orlandster
Orlandster / gallery.js
Created Sep 25, 2018
WooCommerce Twig Single Proudct Gallery with variations
View gallery.js
View gist:4e2cf44829d9a413530b42782c0cdd17
(function ($) {
// display button after 60px scrolled
const showAtOffset = 60;
const $backToTop = $('.scroll-top-wrapper');
// Show and hide the Button
$(document).on( 'scroll', function(){
($(window).scrollTop() > showAtOffset) ? $backToTop.addClass('show'): $backToTop.removeClass('show');
});
View gist:33498d9fa2d6cae9812143eaa437c5a0
// check what will be affected
git clean -n
// remove untracked files
git clean -d
// remove untracked files and folders
git clean -f -d