Recommendations of unit types per media type:
Media | Recommended | Occasional use | Infrequent use | Not recommended |
---|---|---|---|---|
Screen | em, rem, % | px | ch, ex, vw, vh, vmin, vmax | cm, mm, in, pt, pc |
em, rem, % | cm, mm, in, pt, pc | ch, ex | px, vw, vh, vmin, vmax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Convert date/time format between `date()` and `strftime()` | |
* | |
* Timezone conversion is done for Unix. Windows users must exchange %z and %Z. | |
* | |
* Unsupported date formats : S, n, t, L, B, G, u, e, I, P, Z, c, r | |
* Unsupported strftime formats : %U, %W, %C, %g, %r, %R, %T, %X, %c, %D, %F, %x | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Various links | |
// https://serverfault.com/questions/488767/how-do-i-enable-php-s-flush-with-nginxphp-fpm | |
// https://stackoverflow.com/questions/72394213/nginx-configuration-for-server-sent-event | |
// https://serverfault.com/questions/801628/for-server-sent-events-sse-what-nginx-proxy-configuration-is-appropriate | |
// https://qiita.com/okumurakengo/items/cbe6b3717b95944083a1 (in Japanese) | |
// If '?SSE' is set, send Server-Sent events, otherwise we'll display the page. | |
if ( isset( $_GET['SSE'] ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'gform_entry_detail_meta_boxes', 'add_delete_attachment_meta_box', 10, 3 ); | |
function add_delete_attachment_meta_box( $meta_boxes, $entry, $form ) { | |
$my_form_id = 3; | |
if ( $form['id'] == $my_form_id ) { | |
if ( ! isset( $meta_boxes['payment'] ) ) { | |
$meta_boxes['payment'] = array( | |
'title' => esc_html__( 'Delete Attachments', 'gravityforms' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Plugin Name: Example Modify Price | |
*/ | |
class Example_Modify_Price { | |
private static $instance; | |
public static function register() { | |
if (self::$instance == null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.gist-highlight { | |
border-left: 3ex solid #eee; | |
position: relative; | |
} | |
.gist-highlight pre { | |
counter-reset: linenumbers; | |
} | |
.gist-highlight pre div:before { |
NewerOlder