Skip to content

Instantly share code, notes, and snippets.

View umkasanki's full-sized avatar

Oleg Tishkin umkasanki

View GitHub Profile
@umkasanki
umkasanki / better-font-smoothing.css
Created February 5, 2019 06:31 — forked from hsleonis/better-font-smoothing.css
Better font smoothing in cross browser
html {
/* Adjust font size */
font-size: 100%;
-webkit-text-size-adjust: 100%;
/* Font varient */
font-variant-ligatures: none;
-webkit-font-variant-ligatures: none;
/* Smoothing */
text-rendering: optimizeLegibility;
-moz-osx-font-smoothing: grayscale;
{% if craft.request.isAjax %}
{% set layout = "_ajaxLayout" %}
{% else %}
{% set layout = "_layout" %}
{% endif %}
{% extends layout %}
{% set limit = 10 %}
{% set params = { section: 'news', limit: limit} %}
@umkasanki
umkasanki / url-segment.js
Created September 11, 2018 11:45 — forked from jserrao/url-segment.js
Get Last Segment of a URL in Javascript
var pageURL = window.location.href;
var lastURLSegment = pageURL.substr(pageURL.lastIndexOf('/') + 1);
console.log(lastURLSegment);
@umkasanki
umkasanki / _base.twig
Created September 3, 2018 06:13 — forked from wesrice/_base.twig
Sample Modular Templating for Craft CMS - Inspired by principles from https://smacss.com/.
<!DOCTYPE html>
<head>
{# Base #}
{% includeCssFile 'layouts/base/css/base.css' %}
{% includeJsFile 'layouts/base/js/base.js' %}
{# Header #}
{% includeCssFile 'modules/header/css/header.css' %}
{% includeJsFile 'modules/header/js/header.js' %}
@umkasanki
umkasanki / gist:60ce5890213a417f044f44934ec2ed35
Created August 31, 2018 15:28 — forked from devraj/gist:ca0048d136a61bc0de95
Google Maps v3 Custom retina marker from a sprite sheet with 2x and 3x support
var hqLocation = new google.maps.LatLng(-35.107231, 147.369983);
var mapOptions = {
zoom: 17,
minZoom: 17,
maxZoom: 17,
center: hqLocation,
scrollwheel: false,
disableDefaultUI: true,
keyboardShortcuts: false,
@umkasanki
umkasanki / delete-heroku-apps.sh
Created April 12, 2018 05:39 — forked from naaman/delete-heroku-apps.sh
Delete all heroku apps from bash terminal -- no script file required
for app in $(heroku apps); do heroku apps:destroy --app $app --confirm $app; done
@umkasanki
umkasanki / templating.md
Created April 5, 2017 11:06 — forked from brandonkelly/templating.md
Templating in EE vs. Craft
@umkasanki
umkasanki / import.php
Created March 7, 2017 11:54 — forked from lukeholder/import.php
Basic example to import Products and their variants into Craft Commerce
<?php
namespace Craft;
// This file could be placed into your public_html folder and visited to import a cheese product.
$craft = require '../craft/app/bootstrap.php';
$craft->plugins->loadPlugins();
$newProduct = new Commerce_ProductModel();
@umkasanki
umkasanki / gzip-compression
Created January 16, 2017 11:30 — forked from addisonhall/gzip-compression
Gzip configuration that works for now...
# gzip compression -- make it faster!
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript application/x-httpd-php
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip
Header append Vary User-Agent env=!dont-vary
@umkasanki
umkasanki / detect-orientation.js
Created January 16, 2017 11:30 — forked from addisonhall/detect-orientation.js
Detect screen orientation (landscape or portrait)
// Declare globally to use throughout
var deviceOrientation = '';
// ----------------------------------------------------
// Detect screen orientation
// ----------------------------------------------------
function detectOrientation() {
var height = $(window).height();
var width = $(window).width();
if(width > height) {