Skip to content

Instantly share code, notes, and snippets.

View Burick's full-sized avatar
🏠
Работаю из дома

Burick Burick

🏠
Работаю из дома
View GitHub Profile
@Burick
Burick / npm-cheat-sheet.md
Created March 21, 2017 13:32 — forked from AvnerCohen/npm-cheat-sheet.md
Node.js - npm Cheat Sheet

Node.js - npm Cheat Sheet

(Full description and list of commands at - https://npmjs.org/doc/index.html)

##List of less common (however useful) NPM commands

######Prepand ./bin to your $PATH Make sure to export your local $PATH and prepand relative ./node_modules/.bin/:

@Burick
Burick / bootsrap hover
Created March 31, 2017 12:44
Bootstrap hover
$(function(){
'use strict';
const dh = $('[data-hover="true"]');
dh.hover(
function(e) {
$(this).parent().addClass('open');
}, function(e) {
$('.open [data-hover="true"] + .dropdown-menu').hover(
function(e){
@Burick
Burick / og.html
Created April 28, 2017 09:47
Og разметка
<meta property="og:site_name" content="[[++site_name]]" />
<meta property="og:title" content="[[*longtitle]]" />
<meta property="og:description" content="[[*pagetitle]] - [[++site_name]]" />
<meta property="og:type" content="article" />
<meta property="og:url" content="[[~[[*id]]]]" />
<meta property="og:locale" content="ru_RU" />
<meta property="og:image" content="[[*PageImage]]" />
@Burick
Burick / grid-push-pull.less
Created June 2, 2017 08:02 — forked from Evanion/grid-push-pull.less
Responsive push/pull for uikit
/* Small */
@media (max-width: @breakpoint-small-max) {
[class*='uk-push-small-'],
[class*='uk-pull-small-'] { position: relative; }
/*
* Push
*/
<?php
$doc = $modx->newObject('modResource');
$doc->set('createdby', $modx->user->get('id'));
$allFormFields = $hook->getValues();
foreach ($allFormFields as $field=>$value)
{
$doc->set($field, $value);
}
@Burick
Burick / hideDeleted
Created June 4, 2017 13:53 — forked from matdave/hideDeleted
HideDeleted
<?php
/* Set plugin to run on "OnManagerPageBeforeRender"
*/
$user = $modx->getUser();
$restricted = true;
if($user) {
$restricted = (!$user->isMember(array('Administrator')));
}
if($restricted){
$modx->regClientStartupHTMLBlock('<style type="text/css">.deleted{display:none;}</style>');
@Burick
Burick / devChunk
Created June 4, 2017 13:56 — forked from matdave/devChunk
MODX Output Modifier for Serving an Alternate Chunk
<?php
/** devChunk MODX Output Modifier **
**
** Returns an alternate chunk to users in the groups defined below
** Usage [[$livechunk:devChunk=`alternatechunk`]]
**
**/
$user = $modx->getUser();
$restricted = true;
@Burick
Burick / richIntro
Created June 4, 2017 14:01 — forked from matdave/richIntro
MODX Rich Introtext w/ Toggle
<?php
/*
** richIntro
** Plugin checks if introtext is filled in yet, and hides it if not. Run 'onDocFormRender'
** http://g.recordit.co/VOYqBC3CnS.gif
*/
$introtext = empty($resource->get('introtext'));
if($introtext){
$modx->regClientStartupHTMLBlock('<script>Ext.onReady(function() {
var introtext = Ext.getCmp("modx-resource-introtext");
@Burick
Burick / .bash_profile
Created June 4, 2017 14:06 — forked from matdave/.bash_profile
matdave Terminal
archey
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
# 6. Networking
# 7. System Operations & Information
<?php
/* Based on https://gist.github.com/OptimusCrime/dac5deec0d65872740c9d7bccdc5e336
** Add system setting named "max_image_dimension" to set a max height or width for images
*/
if(!function_exists(autoRotateImage)) {
function autoRotateImage($image,$max_image_dimension = 0) {
$orientation = $image->getImageOrientation();
switch($orientation) {
case imagick::ORIENTATION_BOTTOMRIGHT: