Skip to content

Instantly share code, notes, and snippets.

View renarsvilnis's full-sized avatar
🌊

Renārs Vilnis renarsvilnis

🌊
View GitHub Profile
@renarsvilnis
renarsvilnis / _png-svg-fallback.scss
Last active August 29, 2015 14:01
Sass png-svg fallback
// sass svg fallback to png (or your desired extension)
// similar to other fallbacks but this supports < 4 firefox
@mixin png-svg-fallback($url, $extension: '.png') {
background-image: url($url + $extension);
background-image: -webkit-linear-gradient(transparent, transparent), url($url + ".svg");
background-image: linear-gradient(transparent, transparent), url($url + ".svg");
}
@renarsvilnis
renarsvilnis / _remove-focus-color.scss
Last active August 29, 2015 14:01
Sass mixing for removing focus color
// mixin for easy focus color removement
@mixin remove-focus-color {
outline: none;
-webkit-tap-highlight-color: rgba(255, 255, 255, 0); /* mobile webkit */
}
@renarsvilnis
renarsvilnis / youtubeUrlParser.js
Last active December 13, 2017 08:20
Javascript function to validate if url is a valid vimeo video url.
function parseYoutubeUrl(url) {
var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/,
match = url.match(regExp);
return match && match[7].length == 11 ? match[7] : false;
}
@renarsvilnis
renarsvilnis / vimeoUrlParser.js
Last active May 30, 2022 13:56
Javascript helper function to validate if url is a valid Vimeo video url.
function parseVimeoUrl(url) {
const regExp = /(?:https?:\/\/(?:www\.)?)?vimeo.com\/(?:channels\/|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)/;
const match = url.match(regExp);
return match ? match[3] : false;
}
@renarsvilnis
renarsvilnis / css-tricks-n-tips.md
Last active August 29, 2015 14:06
Usefull tricks and tips which i gain from working on projects

TIPS

  • If parent has overflow hidden and child has backface-visibility: hidden; then fonts on chrome <= 37 render blurry due to the are converted to and image upscaled.

FONTS

@renarsvilnis
renarsvilnis / read-length-of-mp3.php
Last active August 29, 2015 14:11
Read length of mp3
<?php
ini_set("max_execution_time", "30000");
// how much detail we want. Larger number means less detail
// (basically, how many bytes/frames to skip processing)
// the lower the number means longer processing time
define("DETAIL", 5);
define("DEFAULT_WIDTH", 500);
@renarsvilnis
renarsvilnis / php-tricks-n-tips.md
Last active August 29, 2015 14:17
Some tips or useful info about PHP that i found interesting or useful at the moment of writing.
@renarsvilnis
renarsvilnis / server-setup-guide-warp.md
Last active December 11, 2022 21:48
Guide for configuring server for apache, php, ssh etc..

DEV SERVER SETUP


A reference for setting up Linux/Ubuntu server for LAMP, Node.js laboratory.

May be helpful for others, hence this git. If it contains errors, please push them.

This assumes