Skip to content

Instantly share code, notes, and snippets.

View adamkudrna's full-sized avatar
🙈

Adam Kudrna adamkudrna

🙈
View GitHub Profile
@adamkudrna
adamkudrna / drupal.js
Created April 21, 2015 08:33
Drupal and custom jQuery JS
(function ($) {
$(document).ready(function(){
// Your code goes here!
});
}(jQuery));
@adamkudrna
adamkudrna / autoprefixer.js
Last active November 1, 2017 11:57
Autoprefixer settings, based on Bootstrap 3
'use strict';
module.exports = {
options: {
browsers: [
'Android 2.3',
'Android >= 4',
'Chrome >= 20',
'Firefox >= 24', // Firefox 24 is the latest ESR
@adamkudrna
adamkudrna / hires.css
Created March 9, 2015 14:19
Hi-dpi/retina media query
@media (min-resolution: 144dpi), (-webkit-min-device-pixel-ratio: 1.5) {
}
@adamkudrna
adamkudrna / .editorconfig
Last active May 2, 2016 14:02
.editorconfig
# http://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
@adamkudrna
adamkudrna / scrolling.js
Created December 17, 2014 00:32
Animated scrolling
// Scrolling
function scrollToElement(element, offset) {
var offsetTop = $(element).offset().top;
if (arguments.length === 2) {
offsetTop += offset;
}
$('html, body').animate({ scrollTop: offsetTop }, 500);
}
// Scroll to content
@adamkudrna
adamkudrna / .htaccess
Created December 8, 2014 20:30
Caching and compression
# ------------------------------------------------------------------------------
# | Better website experience |
# ------------------------------------------------------------------------------
# Force Internet Explorer to render pages in the highest available
# mode in the various cases when it may not.
# https://hsivonen.fi/doctype/#ie8
@adamkudrna
adamkudrna / Gruntfile.js
Last active August 29, 2015 14:10
Starter Gruntfile
'use strict';
module.exports = function (grunt) {
var options = {
pkg: grunt.file.readJSON('package.json'),
paths: {
src: 'assets',
dist: 'www',
@adamkudrna
adamkudrna / map.js
Last active August 29, 2015 14:10
Responsive customised Google map
/**
* Initialize and render customized Google map.
*/
'use strict';
var mapRendered = false;
function Map() {}
@adamkudrna
adamkudrna / email.js
Last active August 29, 2015 14:08
Insert @ into blank email inputs on focus if empty
/**
* Insert @ into blank email inputs on focus if empty.
*/
$('input[type="email"]').focus(function() {
var input = $(this);
if (!input.val()) {
input.val('@');
}
}).blur(function() {
var input = $(this);