Skip to content

Instantly share code, notes, and snippets.

View sergeimuller's full-sized avatar

Sergei Müller sergeimuller

View GitHub Profile
@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/*"]
}
},
@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 / 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 / sh.txt
Created October 10, 2017 11:53
Generate self signed cert for development
cat > openssl.cnf <<-EOF
[req]
distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no
[req_distinguished_name]
CN = *.dev
[v3_req]
keyUsage = keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
@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 / tar.sh
Last active May 21, 2020 15:24
Handy commands
# Compress directory into 500MB archives
tar cvzf - dir/ | split -b 500000000 - output.tar.gz.
# Extract multi-archive tar.gz files
cat output.tar.gz.* | tar xzvf -
@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 / 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 / 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 / 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