Skip to content

Instantly share code, notes, and snippets.

View AntoscencoVladimir's full-sized avatar
💭
Deja vu

Vladimir AntoscencoVladimir

💭
Deja vu
  • Chisinau, Moldova
View GitHub Profile
@AntoscencoVladimir
AntoscencoVladimir / facebook.html
Created January 10, 2017 02:50
Create facebook share button without SDK app
<script>
function fbShare(siteUrl, picture, title, caption, descr, winWidth, winHeight) {
var winTop = (screen.height / 2) - (winHeight / 2);
var winLeft = (screen.width / 2) - (winWidth / 2);
window.open('http://www.facebook.com/sharer.php?s=100&u=' + siteUrl + '&picture=' + picture + '&title=' + title + '&caption=' + caption , '&description=' + descr, 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight);
}
</script>
@AntoscencoVladimir
AntoscencoVladimir / list.html.twig
Created December 20, 2016 14:48 — forked from tentacode/list.html.twig
Twig recursive macro
{% macro recursiveCategory(category) %}
<li>
<h4><a href="{{ path(category.route, category.routeParams) }}">{{ category }}</a></h4>
{% if category.children|length %}
<ul>
{% for child in category.children %}
{{ _self.recursiveCategory(child) }}
{% endfor %}
</ul>
@AntoscencoVladimir
AntoscencoVladimir / grid.css.sass
Created November 5, 2016 10:52 — forked from johnkoht/grid.css.sass
Bootstrap 3 Style Grid built on Bourbon Neat
// Main containers
.container
@include outer-container
// Rows
.row
@include row()
// A basic column without a defined width or height
<?php if (!defined('FW')) die('Forbidden');
// file: {theme}/inc/includes/demo-settings-page.php // https://github.com/ThemeFuse/Theme-Includes
final class _Andromeda_Unyson_Settings_Page
{
/**
* @var FW_Form
*/
private static $settings_form;
<?php
class dekaForm{
function getData(){
$data = "";
$data[] .= fw_get_db_settings_option('email_form');
@AntoscencoVladimir
AntoscencoVladimir / gist:01c60bf1c348cff1a767f3dd9a879f3a
Created July 20, 2016 04:54 — forked from learncodeacademy/gist:5850f394342a5bfdbfa4
SSH Basics - Getting started with Linux Server Administration

###SSH into a remote machine###

ssh user@mydomain.com
#or by ip address
ssh user@192.168.1.1

exit: exit ###Install Something###

#If it's a new server, update apt-get first thing
@AntoscencoVladimir
AntoscencoVladimir / Builder.php
Created June 24, 2016 00:19 — forked from havvg/Builder.php
Symfony2 KnpMenu TwitterBootstrap switch user menu
<?php
namespace Ormigo\Bundle\BackofficeBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
use Ormigo\Bundle\UserBundle\Model\User\UserQuery;
use Symfony\Component\Security\Core\Role\SwitchUserRole;
# Add correct content-type for fonts
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType font/x-woff .woff
AddType image/svg+xml .svg
# Compress compressible fonts
AddOutputFilterByType DEFLATE font/ttf font/otf image/svg+xml
@AntoscencoVladimir
AntoscencoVladimir / functions.php
Created May 5, 2016 16:25
Hide update messages in admin panel
/**
* Hide update messages in admin panel
*/
remove_action( 'admin_notices', 'woothemes_updater_notice' );
@AntoscencoVladimir
AntoscencoVladimir / woo-loop-image-wrap
Last active May 4, 2016 18:09
WooCommerce insert wrapper around thumbnail images in loop -------- Insert in functions.php file
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);
add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);
if ( ! function_exists( 'woocommerce_template_loop_product_thumbnail' ) ) {
function woocommerce_template_loop_product_thumbnail() {
echo woocommerce_get_product_thumbnail();
}
}
if ( ! function_exists( 'woocommerce_get_product_thumbnail' ) ) {