Skip to content

Instantly share code, notes, and snippets.

Avatar

Rastislav Lamos lamosty

View GitHub Profile
@gwwar
gwwar / StackingContext.js
Last active Jul 15, 2016
Given a node, returns the closest stacking context.
View StackingContext.js
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' ) {
View gist:5e6a1e3d02ba993c1415
let Thing = (props) => (
<div>look {props.name}! no state!</div>
)
render(<Thing name="Ma"/>, el)
@austinpray
austinpray / .gitignore
Last active Jun 9, 2016
Test ordering of gulp-less
View .gitignore
# Logs
logs
*.log
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
View deploy.rb
set :application, 'my_app_name'
set :repo_url, 'git@example.com: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 Jun 7, 2012
WP_Rewrite endpoints demo
View endpoints.php
<?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() {