by Ossi Hanhinen, @ohanhi
with the support of Futurice 💚.
Licensed under CC BY 4.0.
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
.pricing-table { | |
margin: 0 0 rem-calc(20) 0; | |
border: 0; | |
background-color: #f0f0f0; |
<?php | |
/** | |
* Gets the current global post type if one is set | |
*/ | |
function x_get_current_post_type() { | |
global $post, $typenow, $current_screen; | |
if( $post && $post->post_type ) | |
$post_type = $post->post_type; | |
elseif( $typenow ) |
<?php | |
add_action( 'init', function () { | |
global $shortcode_tags; | |
foreach ( $shortcode_tags as $tag => $function ) { | |
$shortcode_tags[$tag] = function ( $attr, $content = null ) use ( $tag, $function ) { | |
$expires = 60; | |
$expires = apply_filters( 'shortcode_cache_expires', $expires, $tag ); | |
$cache_key = $tag . md5( serialize( $attr ) ) . get_the_ID(); | |
$cached = wp_cache_get( $cache_key ); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script src="v2p.js"></script> | |
<style type="text/css" media="all"> | |
body { margin: 0; } | |
div { | |
background: #fa7098; | |
} |
<?php | |
/** | |
* Escape all translations with | |
*/ | |
__( ‘Some String’, ‘text-domain’ ); _e( ‘Some string’, ‘text-domain’ );. | |
/** | |
* When there is no HTML use: | |
*/ |
import * as React from 'react'; | |
import { Component, ComponentClass, createRef, forwardRef, Ref } from 'react'; | |
const myHoc = <ComposedComponentProps extends {}>( | |
ComposedComponent: ComponentClass<ComposedComponentProps>, | |
) => { | |
type ComposedComponentInstance = InstanceType<typeof ComposedComponent>; | |
type WrapperComponentProps = ComposedComponentProps & { | |
wrapperComponentProp: number; |
/* | |
* Inspired by: | |
* http://designedbythomas.co.uk/blog/how-detect-width-web-browser-using-jquery | |
* | |
* This script is ideal for getting specific class depending on device width | |
* for enhanced theming. Media queries are fine in most cases but sometimes | |
* you want to target a specific JQuery call based on width. This will work | |
* for that. Be sure to put it first in your script file. Note that you could | |
* also target the body class instead of 'html' as well. | |
* Modify as needed |
#!/usr/bin/env bash | |
# | |
# Generate a set of TLS credentials that can be used to run development mode. | |
# | |
# Based on script by Ash Wilson (@smashwilson) | |
# https://github.com/cloudpipe/cloudpipe/pull/45/files#diff-15 | |
# | |
# usage: sh ./genkeys.sh NAME HOSTNAME IP | |
set -o errexit |