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
<?php
wp_reset_query();
global $withcomments;
$withcomments = 1;
comments_template( '', true );
@escapedcat
escapedcat / package.json
Last active May 16, 2018 09:39
npm scripts including node-sass and autoprefixer
{
"name": "foo",
"version": "1.0.0",
"description": "foo project",
"main": "index.js",
"scripts": {
"start": "npm run serve | npm run watch-css",
"serve": "./node_modules/.bin/http-server -p 8080",
"build-css": "./node_modules/node-sass/bin/node-sass app/sass/style.scss -o app/css/ && ./node_modules/postcss-cli/bin/postcss --use autoprefixer app/css/style.css -d app/css/",
"watch-css": "nodemon -e scss -x 'npm run build-css'"
@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(); });
@agragregra
agragregra / index.html
Last active January 8, 2019 13:14
Google Map jQuery Theme
<!-- Google Map API -->
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOU-API-KEY&amp;sensor=false"></script>
@agragregra
agragregra / easy-form-validator.js
Created March 21, 2015 15:52
Easy Form Validator
//Easy Form Validator
//Example: $("form").evalid("Error message");
//Author URL: http://webdesign-master.ru
(function($) {
$.fn.evalid = function(req_text) {
$(this).find("input[type], textarea").each(function() {
$(this).after("<p class='form_error_message'>" + req_text + "").next().hide();
});
<?php
$images = getFieldOrder('img');
$i = 0;
foreach($images as $image) {
$i++;
$nuevos = array ("w" => 300, "h" => 200, "zc" => 1, "q" => 100);
$image_thumb = get_image('img', 1, $i, 0, NULL, $nuevos);
$image_link = get_image('img', 1, $i, 0, NULL); ?>
<?php echo $image_thumb; ?><br/>
@ikiselev1989
ikiselev1989 / bem-and-sass.md
Last active April 30, 2019 12:47 — forked from radist2s/bem-and-sass.md
BEM & SASS best practices

BEM & SASS best practices

Every block should be in separated file named as block.

Filename: rating-star.scss

.rating-star {
    $font-size: 0.5em;
    
    display: inline-block; // `display` style may be set freely
@rianrainey
rianrainey / mixin-ouput.css
Created September 23, 2013 15:54
Use Bourbon's mixin, @font-face, to easily include Fonts into your project.
/* @include font-face(SourceSansPro, '/fonts/Source_Sans_Pro/SourceSansPro-Regular'); */
@font-face {
font-family: SourceSansPro;
font-weight: normal;
font-style: normal;
src: url(/assets/Source_Sans_Pro/SourceSansPro-Regular.eot);
src: url(/assets/Source_Sans_Pro/SourceSansPro-Regular.eot?#iefix) format("embedded-opentype"),
url(/assets/Source_Sans_Pro/SourceSansPro-Regular.woff) format("woff"),
url(/assets/Source_Sans_Pro/SourceSansPro-Regular.ttf) format("truetype"),
@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>";
}