This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Edit .gitignore to match the file you want to ignore | |
- git rm --cached /path/to/file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
== HTML | |
<div class="wrapper"> | |
<div class="content"></div> | |
</div> | |
== CSS | |
.wrapper { | |
position: absolute; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from https://gist.github.com/kalkulus/5d536faba9a6d4d8c0413a5989cd46ac | |
const utf2ascii = (text) => { | |
const combining = /[\u0300-\u036F]/g; | |
return str.normalize('NFKD').replace(combining, '')); | |
}; | |
const slugify = (text) => { | |
let st = text.toLowerCase(); | |
st = utf2ascii(st); | |
st = st.replace(/[^a-z0-9 ]+/gi,''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// source https://stackoverflow.com/a/23633988 | |
const str = "üó"; | |
const utf2ascii = (text) => { | |
const combining = /[\u0300-\u036F]/g; | |
return str.normalize('NFKD').replace(combining, '')); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://stackoverflow.com/questions/37420642/how-to-undo-the-last-commit-in-git | |
git reset HEAD^ | |
This will bring the dir to state before you've made the commit, HEAD^ means the parent of the current commit | |
(the one you don't want anymore), while keeping changes from it (unstaged). | |
===== | |
https://nakkaya.com/2009/09/24/git-delete-last-commit/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global credential.helper cache | |
# Set git to use the credential memory cache | |
git config --global credential.helper 'cache --timeout=3600' | |
# Set the cache to timeout after 1 hour (setting is in seconds) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout -b newBranchName | |
git branch --set-upstream-to=origin/newBranchName newBranchName | |
OR | |
git push -u origin newBranchName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Node.js CheatSheet. | |
// Download the Node.js source code or a pre-built installer for your platform, and start developing today. | |
// Download: http://nodejs.org/download/ | |
// More: http://nodejs.org/api/all.html | |
// 0. Synopsis. | |
// http://nodejs.org/api/synopsis.html | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /path/to/directories && find . -type d -exec mkdir -p -- /path/to/backup/{} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Symfony\Component\Yaml\Yaml; | |
function flattenKeys($data, $parent = ''){ | |
$result = array(); | |
if (!is_array($data)) { | |
return $result; | |
} | |
foreach ($data as $key => $value) { |
NewerOlder