Skip to content

Instantly share code, notes, and snippets.

new class {
constructor() {
this.nodes = this.find('.position_sticky').map(el => { return { el, placeholder: null } })
window.addEventListener('scroll', e => this.go(), { passive: true })
this.go()
}
go() {
this.nodes.forEach(node => this.check(node))
}
<?php
class SiteOrigin_Widget_InlineCSS extends SiteOrigin_Widget {
function generate_and_enqueue_instance_styles($instance) {
if(empty($this->form_options)) $this->form_options = $this->initialize_form();
if(empty($instance)) return;
$instance = $this->add_defaults($this->form_options, $instance);
$css_name = $this->id_base . '-' . $this->get_style_name($instance) . '-' . $this->get_style_hash($instance);
$css = wp_cache_get($css_name, 'siteorigin_widgets');
@pravdomil
pravdomil / chmod.php
Last active December 8, 2015 10:25
Changes permissions on files and directories
<?
header('Content-Type: text/plain');
function chmod_r($dir)
{
$dp = opendir($dir);
while($file = readdir($dp))
{
if (($file == ".") || ($file == "..")) continue;