Skip to content

Instantly share code, notes, and snippets.

View dandgerson's full-sized avatar
⚛️
what the actual hell happens in this damn component

Dmitry Anderson dandgerson

⚛️
what the actual hell happens in this damn component
View GitHub Profile
@whitershade
whitershade / Посадка на WordPress
Last active June 3, 2021 08:05
Посадка на WordPress
1) header и footer перемещаем в отдельные файлы header.php и footer.php
на их местах в index.php вставляем команды:
<?php get_header();?> // подключаем header
<?php get_footer();?> // подкючаем footer
2) в header.php после всех стилей добавляем функцию <?php wp_head();?>. В footer.php после всех скриптов добавляем <?php wp_footer();?>
3) ко всем локальным путям добавляем функцию по образцу:
<link rel="stylesheet" href="<?php echo get_template_directory_uri();?>/css/main.css">
<script src="<?php echo get_template_directory_uri();?>/js/main.js"></script>
<img src="<?php echo get_template_directory_uri();?>/img/photo.jpg" alt="my-photo">
4) удалить admin bar. В файл functions.php добавить:
@agragregra
agragregra / gulpfile.js
Created January 15, 2016 10:36 — forked from martinwolf/gulpfile.js
Jekyll, Browsersync and Gulp
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
clean = require('gulp-clean'),
concat = require('gulp-concat'),
notify = require('gulp-notify'),
@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>";
}
@rveitch
rveitch / sass-7-1-pattern.scss
Last active April 23, 2024 08:10
Sass 7-1 Pattern
sass/
|
|– base/
| |– _reset.scss # Reset/normalize
| |– _typography.scss # Typography rules
| ... # Etc…
|
|– components/
| |– _buttons.scss # Buttons
| |– _carousel.scss # Carousel
@agragregra
agragregra / media.css
Created December 15, 2015 11:50
Bootstrap Media CSS | Sass
/*========== Desktop First Method ==========*/
/* Large Devices, Wide Screens */
@media only screen and (max-width : 1200px) {
}
/* Medium Devices, Desktops */
@media only screen and (max-width : 992px) {
<!-- 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 / mousewheel-icon.html
Created October 31, 2015 14:52
Mouse Wheel Animation CSS Icon | http://jsfiddle.net/cmajo9h6/
<style>
/* ---------------------------------------------- /*
* Mouse animate icon
/* ---------------------------------------------- */
.mouse-icon {
border: 2px solid #000;
border-radius: 16px;
height: 40px;
width: 24px;
display: block;
@soheilhy
soheilhy / mochatutorial.md
Last active March 18, 2022 05:23
Mocha Tutorial

Testing Node.JS applications using Mocha

Mocha is a unittest framework for Node. In this document, we explain how you can test your javascript code and also your HTTP servers.

Installing Mocha

Use npm to install Mocha:

npm install mocha
@agragregra
agragregra / post-thumbnail.html
Last active January 8, 2019 13:09
WordPress Post Thumbnail URL
<?php $url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large' ); $url = $url['0']; ?>
@agragregra
agragregra / stopdrag.js
Created April 4, 2015 15:53
jQuery Stop Draggable Elements
$("img").on("dragstart", function(event) { event.preventDefault(); });