Skip to content

Instantly share code, notes, and snippets.

View laszlo-horvath's full-sized avatar

László Horváth laszlo-horvath

View GitHub Profile
@shazron
shazron / ios7.phonegap.cordova.js
Last active December 23, 2015 07:39
PhoneGap / Apache Cordova - top margin for iOS 7
// Pre-requisites:
// 1. Device core plugin
// 2. Splashscreen core plugin (3.1.0)
// 3. config.xml: <preference name="AutoHideSplashScreen" value="false" />
// 4. config.xml: <preference name="DisallowOverscroll" value="true" />
function onDeviceReady() {
if (parseFloat(window.device.version) >= 7.0) {
document.body.style.marginTop = "20px";
// OR do whatever layout you need here, to expand a navigation bar etc
@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active April 2, 2024 02:45
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@Cifro
Cifro / gmail-scrollbars.css
Created December 29, 2011 17:23
New Gmail scrollbars for webkit browsers
/*
http://www.webkit.org/blog/363/styling-scrollbars/
*/
.zF.e-Rb::-webkit-scrollbar {
width: 12px
}
.zF.e-Rb::-webkit-scrollbar-thumb {