Skip to content

Instantly share code, notes, and snippets.

View artgris's full-sized avatar
😺

Arthur Gribet artgris

😺
View GitHub Profile
@artgris
artgris / useHexo.md
Created August 24, 2017 06:40 — forked from btfak/useHexo.md
How to use Hexo and deploy to GitHub Pages
@artgris
artgris / gist:3c7dd934491ce406f7b55bea69dd08bd
Created July 24, 2017 07:32
Generate pseudo-random bytes encoding to base64
> openssl rand -base64 6
QBlkom92
@artgris
artgris / git.sh
Created July 19, 2017 14:00
fix wrong email in git history
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="old-email"
CORRECT_NAME="new-name"
CORRECT_EMAIL="new-email"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
sudo curl http://get.sensiolabs.org/php-cs-fixer.phar -o /usr/local/bin/php-cs-fixer
sudo chmod a+x /usr/local/bin/php-cs-fixer
@artgris
artgris / update-a-github-forked-repository
Last active May 9, 2017 07:27
update-a-github-forked-repository
http://stackoverflow.com/questions/7244321/how-do-i-update-a-github-forked-repository
# Add the remote, call it "upstream":
git remote add upstream https://github.com/whoever/whatever.git
# Fetch all the branches of that remote into remote-tracking branches,
# such as upstream/master:
git fetch upstream
@artgris
artgris / How to use the fork of a repository with Composer
Created May 4, 2017 14:23
How to use the fork of a repository with Composer
http://tech.osteel.me/posts/2015/08/10/how-to-use-the-fork-of-a-repository-with-composer.html
{
"name": "osteel/myproject",
"description": "My project.",
"license": "MIT",
"type": "project",
"repositories": [
{
Server
git init --bare --shared
Local
git init
git remote add origin ssh://user@ip/.../server
git add .gitignore
git commit -m "first commit"
@artgris
artgris / git tips and tricks
Last active March 30, 2018 06:52
Removing ignored files
https://github.com/git-tips/tips
https://eric.blog/2014/05/11/remove-files-from-git-addingupdating-gitignore/
git rm --cached <file>
git rm -r --cached .
git add -A
git commit -am 'Removing ignored files'
@artgris
artgris / Git User configuration
Last active March 23, 2017 13:38
Overrides the global git configuration
- An individual repo :
git config user.name "Your Name Here"
git config user.email your@email.com
- Global configuration :
git config --global user.name "Your Name Here"
git config --global user.email your@email.com
use Gedmo\Sluggable\Util\Urlizer;
Urlizer::urlize($text, $separator = '-');