Skip to content

Instantly share code, notes, and snippets.

@Jikizuari
Jikizuari / retina.js
Created December 15, 2015 16:22
Detect Retina display in Javascript
(function(){
if( document.cookie.indexOf('device_pixel_ratio') == -1
&& 'devicePixelRatio' in window
&& window.devicePixelRatio > 1 ){
document.cookie = 'device_pixel_ratio=' + window.devicePixelRatio + '; path=/';
document.cookie = 'retina=1; path=/';
}
})();
@Jikizuari
Jikizuari / gist:bd924271eace2466e29a13cf0c25d278
Created September 15, 2016 11:41
Add Chosen to WordPress parent page selector for easier selecting
<script>
jQuery(document).ready(function ($) {
if ('function' === typeof $.fn.chosen) {
$("#parent_id").chosen({
search_contains: true
});
}
});
</script>
@Jikizuari
Jikizuari / superfish-prevent-hover.js
Created February 3, 2017 08:46
Prevent Superfish from hovering on tablet portrait and lower
var menu = function () {
var window_width = $(document).width(),
menu_element = $('#main-menu ul.menu');
menu_element.superfish();
if (window_width < 1024) {
menu_element.off('mouseenter mouseleave');
}
@Jikizuari
Jikizuari / lbf.sh
Created October 18, 2018 13:28 — forked from rmpel/lbf.sh
Local By Flywheel (unofficial) CLI for MacOS
#!/usr/bin/env bash
BROWSER=
CLOPS=
VERBOSE=true
SHOWHELP=false
SCHEME=http:
SQLPRO="$(mdfind -name Sequel\ Pro | grep Applications | sort | head -n 1)"
while [ "" != "$1" ]; do