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
@snowman-repos
snowman-repos / gist:3825198
Created October 3, 2012 05:28
JavaScript: Detect Orientation Change on Mobile Devices
// Listen for orientation changes
window.addEventListener("orientationchange", function() {
// Announce the new orientation number
alert(window.orientation);
}, false);
// Listen for resize changes
window.addEventListener("resize", function() {
// Get screen size (inner/outerWidth, inner/outerHeight)
@ScottPolhemus
ScottPolhemus / mixins.less
Last active August 12, 2018 20:17
A collection of LESS mixins.
//
// LESS Utility Mixins
// -------------------
// Fill the parent element
.fill(@spacing: 0) {
position: absolute;
top: @spacing; bottom: @spacing;
left: @spacing; right: @spacing;
}
@npostulart
npostulart / simple_breakpoint.scss
Last active November 7, 2017 20:06
Simple Breakpoints Mixin
/// Simple Breakpoint Mixin
///
/// Takes list of arguments to define media queries
///
/// @author Niklas Postulart
/// @group layout
/// @param {Lists} $lists - Lists of queries
/// @example
/// .example {
/// @include breakpoint(min 100px, max 30rem) {
(function($, window, undefined) {
var InfiniteScroll = function() {
this.initialize = function() {
this.setupEvents();
};
this.setupEvents = function() {
$(window).on(
'scroll',
this.handleScroll.bind(this)
@npostulart
npostulart / rem-attributes.scss
Last active November 7, 2017 20:08
REM Mixin for CSS Attributes
// ----
// Sass (v3.3.14)
// ----
@function parseInt($n) {
@return $n / ($n * 0 + 1);
}
@mixin rem($property, $values) {
$px : ();
@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);
@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.

@jtsternberg
jtsternberg / colliding.js
Last active June 27, 2024 16:37 — 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}
*/
/*
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 :)
*/

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.