Skip to content

Instantly share code, notes, and snippets.

View ValeriiVasyliev's full-sized avatar
🏄
Focusing

Valerii Vasyliev ValeriiVasyliev

🏄
Focusing
View GitHub Profile
@ValeriiVasyliev
ValeriiVasyliev / ckeditor-custom-css.js
Created June 13, 2017 19:59
CKEditor add custom css
$(function(){
$('.editor').each(function(e){
CKEDITOR.replace(this.id, {
extraPlugins: 'stylesheetparser',
contentsCss: ['/css/stylenew.css'],
stylesSet: [],
height: '700px',
width: '700px',
on: {
@ValeriiVasyliev
ValeriiVasyliev / __INDEX.txt
Created June 29, 2017 09:42 — forked from facine/__INDEX.txt
Drupal 8 - Examples
# Taxonomy terms:
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_taxonomy_term-php
# Menu links:
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_menu_link-php
# File items:
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_file-php
# Nodes:
DROP FUNCTION IF EXISTS rebuild_nested_set_tree//
CREATE FUNCTION rebuild_nested_set_tree()
RETURNS INT DETERMINISTIC MODIFIES SQL DATA
BEGIN
UPDATE hs_downlines t SET F_LEFT = NULL, F_RIGHT = NULL;
SET @i := 0;
UPDATE hs_downlines t SET F_LEFT = (@i := @i + 1), F_RIGHT = (@i := @i + 1)
WHERE t.F_SPONSOR_ID IS NULL;
@ValeriiVasyliev
ValeriiVasyliev / bitbucket-pipelines-ftp-push.yml
Created July 11, 2017 10:52
bitbucket-pipelines-ftp-push
image: php:5.6.30
pipelines:
default:
- step:
script:
- echo "Pipeline Init"
- apt-get update
- apt-get -qq install git-ftp
- echo "Initiating Push"
<?
function MYMODULE_form_node_admin_content_alter(&$form, &$form_state, $form_id) {
$column_alias = 'my_cool_column';
$column_title = 'Header of my cool column';
// Load the nodes. This incurrs very little overhead as
// "$nodes = node_load_multiple($nids);" has already been run on these
// nids in node_admin_nodes(). The static cache will be used instead of
// another db query being invoked
$nodes = node_load_multiple(array_keys($form['admin']['nodes']['#options']));
@ValeriiVasyliev
ValeriiVasyliev / phpdoc.md
Last active May 18, 2021 08:10
PHPDoc Create

Install

PEAR

pear channel-discover pear.phpdoc.org
pear install PhpDocumentor

If you have a bug, then enter in the console 3 following commands:

@ValeriiVasyliev
ValeriiVasyliev / pearcmd.md
Last active May 18, 2021 08:10
PEAR commands

Configuring your PEAR setup

pear config-show
pear config-get php_dir /usr/share/pear
@ValeriiVasyliev
ValeriiVasyliev / gitcmd.md
Last active October 22, 2021 10:01
GIT commands

GIT commands

Add one or more files to staging (index)

git add <filename>

git add *
@ValeriiVasyliev
ValeriiVasyliev / gist:5e5aec05aead21ecd37d7f7e6a72a294
Created August 7, 2017 06:46 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@ValeriiVasyliev
ValeriiVasyliev / twigcmd.md
Last active May 18, 2021 08:10
Twig base constructions

Variable

{{ var }}

Conditional

{% if conditional %}