Skip to content

Instantly share code, notes, and snippets.

View lamosty's full-sized avatar

Rastislav Lamos lamosty

View GitHub Profile
@gwwar
gwwar / StackingContext.js
Last active July 15, 2016 09:30
Given a node, returns the closest stacking context.
function getClosestStackingContext( node ) {
if( ! node || node.nodeName === 'HTML' ) {
console.log( node, 'has stacking context, reason: root' );
return document.documentElement;
}
const computedStyle = getComputedStyle( node );
if ( computedStyle.position === 'fixed' ) {
console.log( node, 'has stacking context, reason: position: fixed' );
return node;
} else if ( computedStyle.zIndex !== 'auto' && computedStyle.position !== 'static' ) {
let Thing = (props) => (
<div>look {props.name}! no state!</div>
)
render(<Thing name="Ma"/>, el)
@austinpray
austinpray / .gitignore
Last active June 9, 2016 07:04
Test ordering of gulp-less
# Logs
logs
*.log
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
set :application, 'my_app_name'
set :repo_url, '[email protected]:me/my_repo.git'
set :branch, :master
set :deploy_to, -> { "/srv/www/#{fetch(:application)}" }
set :log_level, :info
set :linked_files, fetch(:linked_files, []).push('.env')
set :linked_dirs, fetch(:linked_dirs, []).push('web/app/uploads')
namespace :deploy do
desc 'Restart application'
@joncave
joncave / endpoints.php
Created June 7, 2012 19:41
WP_Rewrite endpoints demo
<?php
/*
Plugin Name: WP_Rewrite endpoints demo
Description: A plugin giving example usage of the WP_Rewrite endpoint API
Plugin URI: http://make.wordpress.org/plugins/2012/06/07/rewrite-endpoints-api/
Author: Jon Cave
Author URI: http://joncave.co.uk/
*/
function makeplugins_endpoints_add_endpoint() {