Skip to content

Instantly share code, notes, and snippets.

View HollyPony's full-sized avatar
😚

Arthur HollyPony

😚
  • France
View GitHub Profile
@HollyPony
HollyPony / .gitignore
Created March 27, 2021 12:58
auto-updater for `npm start` if `package.json` file change
/package.lastInstall
@HollyPony
HollyPony / filterTree.js
Created April 28, 2018 12:35
Basic search in a multi level tree
export function flat (data) {
return data.reduce((acc, branch) => (!branch.data || branch.data.length === 0)
? acc.concat(branch) // Add the branch to the result if no subNodes
: acc.concat(...flat(branch.data).map(item => ({ // If subNodes, reflat it
...item,
name: `${branch.name}.${item.name}` // Update the names of subNodes to follow the path
}))), [])
}
export function flatSimple (keyword, tree) {
@HollyPony
HollyPony / README.md
Last active April 11, 2018 09:48
Commit lockfile in CI

Common usage

The script will check if it's a greenkeeper branch, which is update the package.json. The commit will be a [ci skip], meaning there will not trigger a second build for the push.

You can override this default environment variables:

PROJECT_LOCKFILE="package-lock.json"
GITHUB_EMAIL="task-runner@ci"
GITHUB_NAME="Circle CI<$GITHUB_EMAIL>"
@HollyPony
HollyPony / debug.log
Last active September 6, 2017 07:18
Npm 5.4 error
0 info it worked if it ends with ok
1 verbose cli [ '/Users/aagombart/.nvm/versions/node/v8.4.0/bin/node',
1 verbose cli '/Users/aagombart/.npm/_npx/29357/bin/npm',
1 verbose cli 'i',
1 verbose cli 'messageformat@0.3.1' ]
2 info using npm@5.4.0
3 info using node@v8.4.0
4 verbose npm-session 760e39cdd81ec282
5 silly install loadCurrentTree
6 silly install readLocalPackageData

Git ignore

How to hide files to Git.

  • Gitignore : Complete description and syntax for the .gitignore file
  • Gitattributes : Informations about Git treatment on commit, not describe here

Assuming:

  • Commands are executed on an UNIX System
  • $PROJECT_PATH is the root of the project
@HollyPony
HollyPony / apostrophe-cms-getting-started.md
Last active August 6, 2017 22:45
Issues related to the tutorial doc of apostrophe CMS

Setting up your environment

  • Workflow for OSX only. Confusing link for Linux users redirecting to deployment HOWTO.

Creating Your First Project

  • Sample do not exactly reflect pulled code

Editing Page Templates

@HollyPony
HollyPony / git-orphan.sh
Last active August 6, 2017 22:24
Some git tricks
# List local merged branches excluding master && develop
git branch --merged | egrep -v "(^\*|master|develop)"
# Remove local merged branches
git branch --merged | grep -v master | xargs git branch -d
# Remove all distant merged branches
git branch -r --merged remotes/origin/master | grep -v master | sed 's/origin\///' | xargs -n 1 git push --delete origin