Skip to content

Instantly share code, notes, and snippets.

@nickchauhan
nickchauhan / pause-video-html-video-youtube-vimeo.ts
Created December 1, 2021 11:06
Pause Videos (HTML video / youtube embed/ vimeo embed) programmatically using Javascript / Typescript
// Get all the videos in the slides
const videos: NodeListOf<HTMLVideoElement> = document.querySelectorAll("video");
const iframeVideos: NodeListOf<HTMLIFrameElement> =
document.querySelectorAll("iframe");
// pause all the HTML videos
if (videos.length > 0) {
videos.forEach((videoItem) => {
videoItem.pause();
@agragregra
agragregra / scroll-top.html
Last active December 25, 2022 19:51
Scroll Top Button
<div class="top" title="Наверх"><i class="fa fa-angle-double-up"></i></div>
.top
position: fixed
bottom: 25px
background-color: #E0E0E0
border-radius: 10em
color: #666
font-size: 26px
width: 50px
@agragregra
agragregra / gist:7ae9c76e895b3bacd944
Last active August 16, 2024 19:51
Sublime Text My Settings
// Keymap (Windows Users):
[
{ "keys": ["alt+shift+f"], "command": "reindent" },
]
// Settings:
{
"auto_complete": false,
"bold_folder_labels": true,
"close_windows_when_empty": false,
@agragregra
agragregra / wordpress-get-all-fields.php
Last active October 23, 2019 11:28
WordPress Get All Custom Fields without _edit_lock, _edit_last, _thumbnail_id
<?php
$custom_fields = get_post_custom($post->ID);
foreach ( $custom_fields as $field_key => $field_values ) {
if(!isset($field_values[0])) continue;
if(in_array($field_key,array("_edit_lock", "_edit_last", "_thumbnail_id"))) continue;
echo "<strong>$field_key:</strong> $field_values[0] <br>";
}
<!-- HTML -->
<a href="#" class="toggle-mnu hidden-lg"><span></span></a>
<!-- SASS -->
.toggle-mnu
display: block
width: 28px
height: 28px
margin-top: 14px
@agragregra
agragregra / archive.php
Created April 28, 2015 11:36
WordPress Get Full Content
<?php global $more; $more = 1; the_content(); ?>
/* Small Devices, Tablets */
@media only screen and (max-width : 768px) {
.animated {
/*CSS transitions*/
-o-transition-property: none !important;
-moz-transition-property: none !important;
-ms-transition-property: none !important;
-webkit-transition-property: none !important;
transition-property: none !important;
/*CSS transforms*/
<?php
$idObj = get_category_by_slug('s_about');
$id = $idObj->term_id;
echo get_cat_name($id);
?>
#loader {
background: none repeat scroll 0 0 #ffffff;
bottom: 0;
height: 100%;
left: 0;
position: fixed;
right: 0;
top: 0;
width: 100%;
z-index: 9999;
<?php
$post = $wp_query->post;
if (in_category('cat_label_1')) {
include(TEMPLATEPATH.'/single-cat_label_1.php');
} elseif (in_category('cat_label_2')) {
include(TEMPLATEPATH.'/single-cat_label_2.php');
}
?>