Skip to content

Instantly share code, notes, and snippets.

View lembitk's full-sized avatar

Lembit Kivisik lembitk

View GitHub Profile
@Jakobud
Jakobud / _poly-fluid-sizing.scss
Last active September 18, 2022 14:24
Poly Fluid Sizing using linear equations, viewport units and calc()
/// poly-fluid-sizing
/// Generate linear interpolated size values through multiple break points
/// @param $property - A string CSS property name
/// @param $map - A SASS map of viewport unit and size value pairs
/// @requires function linear-interpolation
/// @requires function map-sort
/// @example
/// @include poly-fluid-sizing('font-size', (576px: 22px, 768px: 24px, 992px: 34px));
/// @author Jake Wilson <jake.e.wilson@gmail.com>
@mixin poly-fluid-sizing($property, $map) {
@petskratt
petskratt / .htaccess
Last active May 22, 2019 07:10
Perishable Press 6G firewall with slight modifications (archive.org bot enabled, no IP blocking part)
# 6G FIREWALL/BLACKLIST
# @ https://perishablepress.com/6g/
# 6G:[QUERY STRINGS]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} (eval\() [NC,OR]
RewriteCond %{QUERY_STRING} (127\.0\.0\.1) [NC,OR]
RewriteCond %{QUERY_STRING} ([a-z0-9]{2000}) [NC,OR]
RewriteCond %{QUERY_STRING} (javascript:)(.*)(;) [NC,OR]
@petskratt
petskratt / .gitignore
Last active January 22, 2020 09:05
Group file change times by inode ctime
.Idea
.DS_Store
var cookieconsent_wrapper = function() {
console.log("I am running");
// Stop from running again, if accidently included more than once.
if (window.hasCookieConsent) return;
window.hasCookieConsent = true;
/*
Constants
*/
@dbox
dbox / Adobe-ask-experts.md
Last active August 1, 2021 13:34
Answer for adobe ask the experts

Q: What is your favorite Css 'trick'?

Responsive images in CSS are pretty easy: just set the width: 100% and height: auto and you're good to go. Things get a little unpredictable, though, when dealing with background images. Since putting a height on the element causes lots of responsive headaches, one workaround is to have the container scale by its aspect ratio. This can be achieved by setting a few attributes to the element's :after tag:

.my-element {
  overflow: hidden;
  position: relative;
}
.my-element:after {
 content: "";
@seksenov
seksenov / cortana.html
Last active May 28, 2022 21:51
Cortana integration from a hosted web app on Windows. To do this you'll need a meta tag in your html page pointint to an xml voice command definition file on your server. You'll also need to handle the Cortana activation event in your JavaScript.
<!DOCTYPE html>
<html>
<head>
<title>Cortana Example</title>
<!--Cortana meta tag pointing to VCD file on the server-->
<meta name="msapplication-cortanavcd" content="https://mysite.com/vcd.xml"/>
</head>
<body>
</body>
@danielpataki
danielpataki / excerpt-length.php
Last active September 13, 2015 17:36
Enhance Posts And Pages
add_filter( 'excerpt_length', 'my_excerpt_length' );
function my_excerpt_length( $length ) {
return 110;
}
@jonathanbardo
jonathanbardo / install_elasticpress.sh
Last active January 15, 2016 03:41
Install Elasticpress
# Download from wordpress.org repository into your plugins folder
# https://wordpress.org/plugins/elasticpress/
# Make sure you have wp-cli installed (otherwise it won't work) http://wp-cli.org/
# Add config line to wp-config.php:
# define( 'EP_HOST', 'http://127.0.0.1:9200' );
# In your docroot (WordPress root folder)
wp plugin activate elasticpress --network
@jonathanbardo
jonathanbardo / install_elasticsearch.sh
Last active January 15, 2016 03:41
Install Elasticsearch
# Install on ubuntu trusty tahr 14.04
# I do this with root user, but if you sudo access with your user it will work too!
sudo su
# Update apt-get
apt-get update
# Install java jdk 7 or java jdk 8 or oracle jdk
apt-get install openjdk-7-jre-headless
# Make sure java is installed
java -version
# This should output: java version "1.7.XX"
<?php
function twitter_metadata($metadata) {
$metadata['twitter:card'] = 'summary';
$metadata['twitter:creator'] = '@willnorris';
foreach (array('url', 'title', 'description', 'image') as $attr) {
if (array_key_exists("og:$attr", $metadata)) {
$metadata["twitter:$attr"] = $metadata["og:$attr"];
}