Skip to content

Instantly share code, notes, and snippets.

View sergeimuller's full-sized avatar

Sergei Müller sergeimuller

View GitHub Profile
@sergeimuller
sergeimuller / keybase.md
Last active August 29, 2015 14:12
keybase.md

Keybase proof

I hereby claim:

  • I am sergeimuller on github.
  • I am sergeimuller (https://keybase.io/sergeimuller) on keybase.
  • I have a public key whose fingerprint is B0C7 DE13 3C3C D056 A6AC 49E7 9188 8FF9 A362 CC37

To claim this, I am signing this object:

@sergeimuller
sergeimuller / gist:2107101
Created March 19, 2012 10:40 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@sergeimuller
sergeimuller / characterCount.js
Last active October 4, 2015 12:37
Dialog Character Count
//characterCount function specified on dialog node
function (textbox, max) {
var count = max - document.getElementById(textbox.el.id).value.length;
var counter = textbox.container.dom.nextElementSibling;
if (count < 0) {
counter.innerHTML = '<b>Max characters: (' + max + ')</b> <span style=\"color:#fb4c50;\">Remaining: (' + count + ')</span><br /><br />' + textbox.fieldDescription;
} else {
counter.innerHTML = '<b>Max characters: (' + max + ')</b> Remaining: (' + count + ')<br /><br />' + textbox.fieldDescription;
}
}
@sergeimuller
sergeimuller / gist:3121577
Created July 16, 2012 08:40
Wordpress Recommended File & Folder Permissions
Root directory 0755
wp-admin 0755
wp-content 0755
wp-includes 0755
.htaccess 0640
readme.html 0400
wp-config.php 0644
wp-admin/index.php 0644
wp-admin/.htaccess 0640
@sergeimuller
sergeimuller / font-face.css
Last active October 7, 2015 09:27
Cross-browser @font-face syntax
/* Sample @font-face declaration for EOT & TTF/OTF recommended by Paul Irish */
@font-face {
font-family: 'Graublau Web';
src: url('GraublauWeb.eot?') format('eot'),
url('GraublauWeb.woff') format('woff'),
url('GraublauWeb.ttf') format('truetype');
}
/* Read the full article: http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/ */
@sergeimuller
sergeimuller / welcome-screen.md
Last active May 2, 2017 10:51
AEM Welcome Screen Customisation

Modules

Module Path
Websites /libs/wcm/core/content/siteadmin
Digital Assets /libs/wcm/core/content/damadmin
Communities /libs/collab/core/content/admin
Campaigns /libs/mcm/content/admin
Inbox /libs/cq/workflow/content/inbox
Users /libs/cq/security/content/admin
@sergeimuller
sergeimuller / JcrQueryLibrary.md
Created September 25, 2017 11:44 — forked from floriankraft/JcrQueryLibrary.md
Some useful JCR queries (XPATH, SQL2) for AEM/CQ development.

SQL2

All nodes with a specific name

SELECT * FROM [nt:unstructured] AS node
WHERE ISDESCENDANTNODE(node, "/search/in/path")
AND NAME() = "nodeName"

All pages below content path

@sergeimuller
sergeimuller / range.js
Last active July 10, 2018 11:40
ES6 implementation of python-like range function
/*
TODO: Fix case where startOrRange is
*/
function range(startOrRange, end = null, step = null) {
if (!startOrRange) return null; // Return null if no parameters are passed
const rangeArray = []; // Array to be populated
@sergeimuller
sergeimuller / git_notes.md
Created November 22, 2019 11:34 — forked from jaygooby/git_notes.md
Git, you bloody git

Remove all local tracking branches to a remote & then delete the remote

git remote prune origin && git remote rm origin

Force checkout a branch to avoid the commit or stash your changes warning

Sometimes when you want to checkout a branch, even though your current branch is clean, you'll get a failed partial checkout, because a file in your current branch will be changed by the new branch (Looking at you .xcodeproj files). As long as you know your current branch is clean and up-to-date, -f force the checkout

git checkout -f the_branch

@sergeimuller
sergeimuller / jsconfig.json
Created January 15, 2020 13:07
CRA jsconfig.json for module resolution
{
"compilerOptions": {
"baseUrl": "./src",
"allowSyntheticDefaultImports": false,
"module": "commonJS",
"target": "es6",
"paths": {
"*/*": ["./src/*"]
}
},