Skip to content

Instantly share code, notes, and snippets.

Avatar

Robert Stark iamrobert

View GitHub Profile
@iamrobert
iamrobert / getCSS-getJS.js
Created May 31, 2021
Vanilla JS | Get CSS & JS Example
View getCSS-getJS.js
/* + GET JS
-----------------------------------------------------------------------
https://stackoverflow.com/questions/16839698/jquery-getscript-alternative-in-native-javascript
==========================================================================*/
var getJS = function getJS(url) {
return new Promise(function(resolve, reject) {
var script = document.createElement("script");
script.src = url;
script.async = true;
@iamrobert
iamrobert / codyhouse-mega-menu.js
Created May 23, 2021
CodyHouse Mega Menu with level 1 click, and disable on mobile
View codyhouse-mega-menu.js
// File#: _3_mega-site-navigation
// Usage: codyhouse.co/license
// iamrobert code to prevent click on touch
(function () {
var MegaNav = function (element) {
this.element = element;
this.search = this.element.getElementsByClassName('js-mega-nav__search');
this.searchActiveController = false;
this.menu = this.element.getElementsByClassName('js-mega-nav__nav');
this.menuItems = this.menu[0].getElementsByClassName('js-mega-nav__item');
@iamrobert
iamrobert / zurb-prepros.js
Last active May 23, 2021
Prepros Zurb FIle
View zurb-prepros.js
/* + FOUNDATION 6.6.3 JS PREPOS FILE
======================================================================
1. Copy Files From dist/js/plugins folder on github
2. Remove @prepend for unneeded files
3. Probably best to start from bottom for uneeded files
----------------------------------------------------------------------
*/
//CORE FILES
//@prepend zf/foundation.core.min.js
//@prepend zf/foundation.util.box.min.js
@iamrobert
iamrobert / select.txt
Created Mar 29, 2021
TAIWAN AREA and REGIONS (FLEXIContent Select FIelds)
View select.txt
001_keelung_city::基隆市%%
002_taipei_city::台北市%%
003_new_taipei_city::新北市%%
004_hsinchu_city::新竹市%%
005_hsinchu_county::新竹縣%%
006_taoyuan_city::桃園市%%
007_miaoli_county::苗栗縣%%
008_taichung_city::台中市%%
009-changhua_county::彰化縣%%
010_nantou_county::南投縣%%
@iamrobert
iamrobert / dealer3.php
Last active Feb 16, 2021
FLEXIcontent UCM: Dealer with City > Region
View dealer3.php
<style>
* {
box-sizing: border-box;
}
.cell-items {
margin-right: 15px;
}
.cell-item {
width: 50%;
float: left;
@iamrobert
iamrobert / dealer2.php
Last active Feb 16, 2021
FLEXIcontent UCM:: Order by 2 fields. City.... Region: 2 DropDowns
View dealer2.php
<style>
*{
box-sizing: border-box;
}
.cell-items{
margin-right: 15px;
}
.cell-item{
width: 50%;
float: left;
@iamrobert
iamrobert / dealer.php
Last active Feb 16, 2021
FLEXIcontent Universal Module - Dealer by Magellan
View dealer.php
<?php
/*
* =======================================================================
+ DEALER TEMPLATE
-----------------------------------------------------------------------
Jan 2019
* =======================================================================
*/
@iamrobert
iamrobert / Joomla Less Compiler php7.4 fix
Last active Jul 17, 2020
Less Compiler lessc-0.3.9.php php7.4 compatibility fix |
View Joomla Less Compiler php7.4 fix
Less Compiler:
https://extensions.joomla.org/extension/miscellaneous/development/less-compiler/
https://github.com/ndeet/plg_system_less
The lessc-0.3.9.php is incompatible with php7.4. It gives the following notices:
https://github.com/ndeet/plg_system_less/issues/39
So replace this file:
@iamrobert
iamrobert / rsform.php
Created Jul 14, 2020
rsform honeypot
View rsform.php
$spam = false;
if($_POST['form']['HoneyPotFieldName'] != '') {
$spam = true;
}
if (preg_match( "/bcc:|cc:|multipart|\[url|Content-Type:/i", implode($_POST['form']))) {
$spam=true;
}
@iamrobert
iamrobert / app.banner.js
Created Jun 23, 2020
Banner - can't get subheading to remove animation
View app.banner.js
app.banner = {
init: function() {
if (!document.querySelector("#mainslider")) {
return;
}
var transitionEnd = whichTransitionEvent();