Skip to content

Instantly share code, notes, and snippets.

Avatar

Serge Rodovnichenko SergeR

  • Moscow, Russia
View GitHub Profile
@kerstvo
kerstvo / phpstorm-wa-live-templates.xml
Last active July 31, 2020 19:18
PHPStorm WA live templates
View phpstorm-wa-live-templates.xml
<template name="wa-fields" value="&lt;div class=&quot;block fields&quot;&gt;&#10;&#10; &lt;div class=&quot;field-group&quot;&gt;&#10; &lt;div class=&quot;field&quot;&gt;&#10; &lt;div class=&quot;name&quot;&gt;&lt;/div&gt;&#10; &lt;div class=&quot;value&quot;&gt;&lt;/div&gt;&#10; &lt;/div&gt;&#10; &lt;/div&gt;&#10;&#10; &lt;div class=&quot;field-group&quot;&gt;&#10; &lt;div class=&quot;field&quot;&gt;&#10; &lt;div class=&quot;value&quot;&gt;&#10; &lt;input type=&quot;button&quot; class=&quot;button&quot; value=&quot;Save&quot; /&gt;&#10; &lt;/div&gt;&#10; &lt;/div&gt;&#10; &lt;/div&gt;&#10; &#10;&lt;/div&gt;" description="fields" toReformat="true" toShortenFQNames="true">
<context>
<option name="HTML" value="true" />
<option name="PHP" value="true" />
<option name="Twig" value="true" />
<option name="Vue" value="true" />
</context>
</template>
<template name="wa-form-field" value="&lt;div class=&quot;field&quot;&gt;&#1
View Да блин, я случайно закоммитил не в ту ветку!
# откатываем последний коммит, но не удаляем изменения
git reset HEAD~ --soft
git add .
git stash
# переключаемся на нужную ветку
git checkout имя-верной-ветки
git stash pop
git add .
git commit -m "тут ваш комментарий"
# теперь изменения в нужной ветке
View xpath-cheatsheet.js
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
@hakre
hakre / README.md
Last active August 18, 2022 12:57
Iterators for PHP XMLReader for ease of parsing
View README.md

Iterators for PHP XMLReader for Ease of Parsing

Change Log:

  • 0.1.12 maintenance release with fixes.

  • 0.1.11 maintenance release with fixes. added XMLReader::CDATA and XMLReader::WHITESPACE node support for XMLWritingIteration. added

@ceeram
ceeram / gist:3852324
Last active October 11, 2015 11:28
cakephp submodule
View gist:3852324
cd to app
git submodule add git://github.com/ceeram/cakephp.git Core
<optional>
cd Core
git checkout 2.4
cd ..
</optional>
//update webroot/index.php:
@dahnielson
dahnielson / UUID.php
Last active January 7, 2023 03:07
Pure PHP UUID generator
View UUID.php
<?php
/**
* UUID class
*
* The following class generates VALID RFC 4122 COMPLIANT
* Universally Unique IDentifiers (UUID) version 3, 4 and 5.
*
* UUIDs generated validates using OSSP UUID Tool, and output
* for named-based UUIDs are exactly the same. This is a pure
* PHP implementation.
@oppara
oppara / gist:132274
Created June 18, 2009 23:13
php: mb_trim
View gist:132274
function mb_trim( $str ) {
return mb_ereg_replace(
'^[[:space:]]*([\s\S]*?)[[:space:]]*$', '\1', $str );
}