Skip to content

Instantly share code, notes, and snippets.

@adamrosloniec
adamrosloniec / gist:9e23c6e380136ed4319d
Created October 2, 2015 14:43
css-tricks - background image - text on images - before/after
https://css-tricks.com/design-considerations-text-images/
@adamrosloniec
adamrosloniec / gist:a3b376b32e8e423b0b48
Created October 8, 2015 18:36
online - encode svg - converter
http://codepen.io/jakob-e/pen/doMoML
@adamrosloniec
adamrosloniec / gist:438e7ab6244349998c0b
Created October 11, 2015 21:11
google maps - parallax horizontal line fix - white horizontal line fix
// google maps - parallax - white color - horizontal line - fix
// just inside it in styles css
$COLOR = your google maps background color - it's color of horizontal line
.gm-style > div:first-child {
background-color: $COLOR;
}
// example:
@adamrosloniec
adamrosloniec / gist:6b3eb6988e892c9a10a8
Created October 17, 2015 01:46
wordpress function - add responsive thumbnail / hero-image.jpg with ACF - add <style> to wp_head
add_action( 'wp_head', 'motyw_add_custom_style_css', 1000 );
function motyw_add_custom_style_css() { ?>
<?php $queried_object = get_queried_object(); // fix dla kategorii ?>
<?php if ( function_exists( 'the_field' ) ) : ?>
<style type="text/css">
@adamrosloniec
adamrosloniec / gist:216534181ba1ed7d627e
Created October 17, 2015 04:59
google maps svg + data64 - dynamic JS generator
// google maps svg + data64 - dynamic JS generator
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 11,
center: new google.maps.LatLng(-10.22, 100.44),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var template = [
'<?xml version="1.0"?>',
@adamrosloniec
adamrosloniec / gist:d2362b7b7931990200af
Created October 22, 2015 12:00
htaccess deny from all - allow only safe files
# htaccess to folder /wp-content/ and /uploads/ and /themes/
order deny,allow
deny from all
<files ~ ".(xml|css|js|svg|svgz|ttf|tiff|tif|otf|eot|woff|woff2|jpg|jpeg|mp3|mp4|asf|wmv|mpg|mpeg|avi|mov|wav|wma|wave|ogg|m4a|ogv|mp4|m4v|ico|webp|webm|swf|flv|bmp|png|gif|pdf|doc|docx|xls|rtf|pps|ppt|pptx|zip|rar)$">
allow from all
</files>
@adamrosloniec
adamrosloniec / gist:07127030971583c99a6b
Last active February 18, 2017 12:11
htaccess - wordpress right way
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
@adamrosloniec
adamrosloniec / gist:dcb2e10249a30db5625a
Last active October 23, 2015 19:34
wordpress security - if not defined ABSPATH exit - else get_header
<?php if ( ! defined( 'ABSPATH' ) ) exit; get_header(); ?>
@adamrosloniec
adamrosloniec / gist:fb4157a08a9dca6bae11
Created March 5, 2016 20:23
sublime text - sidebar - ignore .DS_Store Raw
// open: Preferences -> Settings -> User
// and add:
{ "file_exclude_patterns": [".DS_Store"] }
@adamrosloniec
adamrosloniec / gulpfile.js
Created March 6, 2016 17:34
gulpfile - to folder up (without folder like build/dist/etc)
// ### move all files to /src/ folder, and gulp output fils to folder up (without folder like a build/dist/etc) all files are moved to folder up
// src/gulpfile.js
// src/scss/
// src/images/
// src/js/
// export to ../
// ### example:
// themes/theme_name/src/scss/main.scss
// move to:
// themes/theme_name/main.min.css