Skip to content

Instantly share code, notes, and snippets.

View MarvelMoe's full-sized avatar

Mr. Himed MarvelMoe

  • bay area
View GitHub Profile
@bjorn2404
bjorn2404 / wp_kses_post_tags.php
Last active April 22, 2024 15:08
WordPress allow iFrames with wp_kses_post filter
<?php
/**
* Add iFrame to allowed wp_kses_post tags
*
* @param array $tags Allowed tags, attributes, and/or entities.
* @param string $context Context to judge allowed tags by. Allowed values are 'post'.
*
* @return array
*/
@donmccurdy
donmccurdy / installing-live-server.md
Last active March 27, 2024 20:30
Installing Node.js live-server

Installing Node.js live-server

The NodeJS live-server package runs a temporary server displaying any HTML/CSS/JS resources in the current folder. It automatically reloads the page in your browser when any of these files change.

OS X

  • Verify that Node.js is installed. If you see anything when you run which npm in a terminal, it is. If not, follow the instructions at nodejs.org to install.
  • Install live-server: npm install -g live-server
  • Move your terminal to where your pages live: cd <path-to-content>
  • Start the server: live-server .
@tmocellin
tmocellin / React Scroll Event
Created August 3, 2015 14:05
Handle the scroll event in react js and change the navbar class when special section is on top of windows
var Hello = React.createClass({
getOffset : function(element){
var bounding = element.getBoundingClientRect();
return {
top: bounding.top + document.body.scrollTop,
left: bounding.left + document.body.scrollLeft
};
},