Skip to content

Instantly share code, notes, and snippets.

View adamkudrna's full-sized avatar
🙈

Adam Kudrna adamkudrna

🙈
View GitHub Profile
@adamkudrna
adamkudrna / userContent.css
Last active April 2, 2024 10:55
Turn Netlify links into buttons using GitHub design tokens (Firefox user CSS)
/**
* Make Netlify deploy preview links on GitHub stand out.
*/
@-moz-document domain("github.com") {
/* Turn Netlify links into buttons using GitHub design tokens. */
.comment-body a[href$="netlify.app"] {
position: relative;
display: block;
margin-block: 1em;
padding: 1em;
@adamkudrna
adamkudrna / drush
Created January 31, 2017 14:24
Drush commands
# Import DB using Drush
$ drush sql-cli < db.sql
$ drush cc all
@adamkudrna
adamkudrna / settings.php
Created January 25, 2017 13:37
Drupal 7 disable cache in settings.php
$conf['cache'] = 0; // Page cache
$conf['page_cache_maximum_age'] = 0; // External cache TTL
$conf['preprocess_css'] = FALSE; // Optimize css
$conf['preprocess_js'] = FALSE; // Optimize javascript
$conf['views_skip_cache'] = TRUE; // Views caching
@adamkudrna
adamkudrna / .htaccess
Last active May 10, 2016 08:27
Redirect to www, enable GZIP, enable caching
# Redirect to www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
# Add correct content-type for fonts
AddType application/vnd.ms-fontobject .eot
AddType application/x-font-ttf .ttf
AddType application/x-font-opentype .otf
AddType application/x-font-woff .woff
@adamkudrna
adamkudrna / plugin.js
Created July 27, 2015 19:42
CKEditor nbsp plugin
/**
* @file insert Non-Breaking SPace for CKEditor
* Copyright (C) 2014 Alfonso Martínez de Lizarrondo
* Create a command and enable the Ctrl+Space shortcut to insert a non-breaking space in CKEditor
*
*/
CKEDITOR.plugins.add( 'nbsp',
{
init : function( editor )
@adamkudrna
adamkudrna / .htaccess
Created July 22, 2015 09:49
Redirect Apple touch icons
# Redirect Apple touch icons.
RedirectMatch 301 ^/apple-touch-icon(.*)?\.png /images/icon/touch-icon.png
@adamkudrna
adamkudrna / bootstrap-fix.less
Last active August 29, 2015 14:24
Bootstrap 2 + current LESS
// Fix old LESS syntax in Bootstrap 2.
#grid {
.core {
.span (@columns) {
width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
}
}
}
@adamkudrna
adamkudrna / web.config
Created June 12, 2015 23:33
IIS deny from all 401
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<security>
<authorization>
<remove users="*" roles="" verbs="" />
<add accessType="Allow" roles="Administrators" />
</authorization>
</security>
</system.webServer>
@adamkudrna
adamkudrna / browserSync.js
Created May 22, 2015 18:39
BrowserSync + Tracy
'use strict';
module.exports = {
dev: {
bsFiles: {
src : [
'<%= paths.dist %>/css/*.css',
'<%= paths.dist %>/js/*.js',
'<%= paths.dist %>/images/**/*.svg',
@adamkudrna
adamkudrna / svg-src-fallback.js
Last active August 31, 2015 14:29
SVG src fallback by Jobs UI
/*
* Replaces SVG images in img elements with PNG alternative
*
* The PNG file must have the same URL as the SVG file, up to the extension.
*/
$(function () {
'use strict';
function supportsSvg() {