Skip to content

Instantly share code, notes, and snippets.

View zeljkoprsa's full-sized avatar

Željko Prša zeljkoprsa

View GitHub Profile

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
<?php
// Get store data
Mage::app()->getStore();
// Store Id
Mage::app()->getStore()->getStoreId();
// Store code
Mage::app()->getStore()->getCode();
@zeljkoprsa
zeljkoprsa / git-ignore-file-mode.txt
Created January 16, 2015 14:42
Ignore file mode (chmode) changes. Tip: Remove -- global for local folder only.
git config --global core.fileMode false
@zeljkoprsa
zeljkoprsa / external-font.xml
Created January 6, 2015 18:07
Set external font reference via xml
<action method="addLinkRel"><rel>stylesheet</rel><href>//fonts.googleapis.com/css?family=PT+Sans:400,700,400italic</href></action>
@zeljkoprsa
zeljkoprsa / viewport.xml
Created January 6, 2015 18:06
Set viewport meta via XML
<block type="core/text" name="head.viewport">
<action method="setText"><text><![CDATA[<meta name="viewport" content="initial-scale=1.0, width=device-width" />]]>&#10;</text></action>
</block>
@zeljkoprsa
zeljkoprsa / cms-static-block.xml
Created January 6, 2015 18:04
Add Cms static block via XML within appropriate store view
<STORE_de>
<reference name="left">
<block type="cms/block" name="cms_static_block_id_de">
<action method="setBlockId"><block_id>cms_static_block_id_de</block_id></action>
</block>
</reference>
</STORE_de>
<STORE_en>
<reference name="left">
<block type="cms/block" name="cms_static_block_id_en">
@zeljkoprsa
zeljkoprsa / osx-scrollbar-visible.css
Created December 17, 2014 15:41
OSX Webkit Scrollbar allways visible.
/* Make scroll bar always visible on any element - Webkit on OSX */
::-webkit-scrollbar {
-webkit-appearance: none;
width: 7px;
}
::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: rgba(0, 0, 0, .5);
-webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5);
}
#
# @author Jonathon byrd
#
############################################################
# first things first, set your iptables for a web server. If you jack these
# up you don't want to have to re-install your os after doing much more.
# @see http://www.thegeekstuff.com/2011/06/iptables-rules-examples/
# and
# @see https://help.ubuntu.com/community/IptablesHowTo
#
# @author Jonathon byrd
#
############################################################
# first things first, set your iptables for a web server. If you jack these
# up you don't want to have to re-install your os after doing much more.
# @see http://www.thegeekstuff.com/2011/06/iptables-rules-examples/
# and
# @see https://help.ubuntu.com/community/IptablesHowTo
# This is a basic VCL configuration file for PageCache powered by Varnish for Magento module.
# default backend definition. Set this to point to your content server.
backend default {
.host = "127.0.0.1";
.port = "8000";
.first_byte_timeout = 300s;
}
# add your Magento server IP to allow purges from the backend