Skip to content

Instantly share code, notes, and snippets.

View robert-neacsu's full-sized avatar
🏠
Working from home

Robert Neacsu robert-neacsu

🏠
Working from home
View GitHub Profile
@dtbaker
dtbaker / wordpress-hook-debug-snippet.php
Created January 6, 2020 00:28
WordPress hook call stack debug
// WordPress hook call stack debug:
$debug = debug_backtrace();
foreach($debug as $item){
echo $item['file'] .':' .$item['line'] .' - '.$item['function'].'()' ."\n";
if(!empty($item['args']) && is_array($item['args']) && isset($item['args'][1]) && is_string($item['args'][1])){
echo ' --- '. $item['args'][1] ."\n";
}
}
<img srcset="image-320w.jpg 320w,
image-480w.jpg 480w,
image-800w.jpg 800w"
sizes="(max-width: 320px) 300px,
(max-width: 480px) 440px,
800px"
src="image-800w.jpg" alt="Image">
@tunguskha
tunguskha / How to couple Sass and CSS Variables.md
Last active March 19, 2019 22:42
How to couple Sass and CSS Var

How to couple Sass and CSS Var

If you use Sass extension, you can work with CSS variables.

First, let's create our css variable.

\:root
  --MyColor: #5966D2
@aantipov
aantipov / react2ng1.js
Last active October 4, 2022 18:52
A simple way to convert React components into AngularJS components
import React from "react";
import ReactDOM from "react-dom";
import { fromPairs, map, pick } from "ramda";
/**
* Wraps a React component into Angular component. Returns a new Angular component.
*
* Usage: angular.module('some.module').component('newAngularComponent', react2angular(MyReactComponent))
* (the usage is the same as in similar lib https://github.com/coatue-oss/react2angular)
*/
@craigmdennis
craigmdennis / _tools_fonts.scss
Last active January 25, 2018 16:18
Generated by SassMeister.com.
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
$font-name: 'GT-Walsheim';
$font-path: '../fonts/';
$weights: (
400 'Regular',

Video.js Minimal Skin

Minimalist skin for Video.js. Can be modified to make custom skins.

The great thing about Video.js skins is they work in both HTML5 video AND Flash!

A Pen by Juan D. Jara on CodePen.

License.

/*
See: https://www.smashingmagazine.com/2016/05/fluid-typography/
1. without support for anything, the font size will be the minimum font-size (14px) so nothing will break.
2. with support for mediaqueries and not vw or calc or both then the font will jump up a pixel size at every appropriate breakpoint (I'm using http://include-media.com for syntactic-sugar, but you could rewrite without this)
3. with support for mediaqueries and calc and vw it will work as the article describes, with the fixes for older Safari and IE too
Ain't it pretty!? Haha - works well tho :)
*/
@jtsternberg
jtsternberg / colliding.js
Last active October 31, 2022 18:43 — forked from JayWood/colliding.js
Detect if two elements are colliding/overlapping
/**
* Detects if two elements are colliding
*
* Credit goes to BC on Stack Overflow, cleaned up a little bit
*
* @link http://stackoverflow.com/questions/5419134/how-to-detect-if-two-divs-touch-with-jquery
* @param $div1
* @param $div2
* @returns {boolean}
*/
@npostulart
npostulart / README.md
Last active August 19, 2018 21:52
Simple Feature Detection Library

Simple Feature Detection Library to check JS, SVG and Touch support. Replaces no-js class on html element with js, adds no-svg if no support for SVG and touch or no-touch depending on the used device.

@npostulart
npostulart / convert-function.scss
Last active July 18, 2022 14:21
Unit Converting Sass Function
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
$baseSize: 16px;
$convertBase: $baseSize;
html {
font-size: percentage($baseSize / 16px);