module Kernel
# Constants defined in Kernel
A = B = C = D = E = F = "defined in kernel"
end
# Top-level or "global" constants defined in Object
A = B = C = D = E = "defined at toplevel"
class Super
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
cp -R $(ls | grep -v -e XXX -e YYY) ZZZ/ |
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
// Click event happened in iframe won't propagate to the containing element of it. | |
// This script provides a workaround to simulate the propagation of click event of iframe. | |
// | |
// inspired by https://gist.github.com/jaydson/1780598#gistcomment-2609301 | |
(function ($) { | |
var selector = '[data-event-category][data-event-action]'; | |
var $elementsContainIframe = $(selector).filter(function () { | |
return $(this).find('iframe,script').length; |
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
/* | |
# Usage | |
1. Place this script anywhere after your gpt tag. | |
2. Add class `js-gpt-fluid-size` to your slot element. | |
# Notice | |
This script require jQuery to be installed, | |
but you can place this script before jQuery if you want. | |
*/ |
The singleton methods of an object are not defined by the class of that object. But they are methods and they must be associated with a class of some sort. The singleton methods of an object are instance methods of the anonymous singleton-class(eigenclass) associated with that object.
To open the singleton-class of the object obj
, use class << obj
class Object
# Get the singleton-class object of a class object.
def singleton_class
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
UPDATE wp_options SET option_value = replace(option_value, 'http://OLD', 'https://NEW') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://OLD','https://NEW'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://OLD', 'https://NEW'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://OLD','https://NEW'); |
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
@mixin responsive-property($max-amount,$min-amount,$max-viewport-width,$min-viewport-width,$properties) { | |
@media (min-width: $min-viewport-width) { | |
& { | |
$amount-difference: $max-amount - $min-amount; | |
$viewport-width-difference: $max-viewport-width - $min-viewport-width; | |
@each $property in $properties { | |
#{$property}: calc(#{$min-amount} + ((1vw - #{$min-viewport-width / 100}) * #{100 * $amount-difference / $viewport-width-difference})); | |
} | |
} | |
} |
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
@mixin responsive-font-size($max-font-size,$min-font-size,$max-viewport-width,$min-viewport-width) { | |
@media (min-width: $min-viewport-width) { | |
:root { | |
$font-size-difference: $max-font-size - $min-font-size; | |
$viewport-width-difference: $max-viewport-width - $min-viewport-width; | |
font-size: calc(100% + ((1vw - #{$min-viewport-width / 100}) * #{100 * $font-size-difference / $viewport-width-difference})); | |
} | |
} | |
// Stop font scaling above $max-viewport-width |
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
$post_type = 'your-post-type'; | |
add_filter("edit_{$post_type}_per_page", function ($posts_per_page) { | |
return 999; | |
}); | |
// Search `edit_{$post_type}_per_page` in `wp-admin/includes/post.php` for more infomation. |
NewerOlder