Skip to content

Instantly share code, notes, and snippets.

View quimic-gist's full-sized avatar

quimic-gist quimic-gist

View GitHub Profile
@quimic-gist
quimic-gist / gist:2a607cef1f36d9803ba5b228b8692479
Last active September 19, 2019 08:03
Sync with repo without cloning (keeping local files)
#This will leave local unmanaged files untouched
# Clone just the repository's .git folder into an empty temporary directory
git clone --no-checkout my-project-repo my-project.tmp # might want --no-hardlinks for cloning local repo
# Move the .git folder to the directory with the files.
mv my-project.tmp/.git ./
# Delete the temporary directory
rmdir my-project.tmp
@quimic-gist
quimic-gist / drush-git.sh
Created December 15, 2014 09:23
Drupal:Manage modules with git and keep version in info file
# download git version of drupal moodule to be patched, while keeping version in info file
drush pm-download module_name --package-handler=git_drupalorg --gitinfofile
# apply patch
git apply -v path/file.patch
@quimic-gist
quimic-gist / deploy.sh
Created December 11, 2014 10:14
Drupal: Deploy update
#Put site in maintenance mode
drush vset maintenance_mode 1
#Clear cache
drush cron
drush cc all
#Backup db
drush sql-dump --result-file=../before-update-xx.sql --gzip
@quimic-gist
quimic-gist / gist:30acfe9386dcc8bcd2f0
Last active August 29, 2015 14:11
Drupal: Update core if security update
#Put site in maintenance mode
drush vset maintenance_mode 1
#Enable updates
drush en update -y
#run cron
drush cron
#refresh update status
@quimic-gist
quimic-gist / gist:cb77aa35f0cba33f5738
Created December 11, 2014 09:54
OSX: Show / hide hidden files
#Show:
defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder
#Hide:
defaults write com.apple.finder AppleShowAllFiles -boolean false ; killall Finder
@quimic-gist
quimic-gist / gist:5b5019ac1425a0b8916e
Created December 11, 2014 09:52
Git:Find git root directories in home folder
#Find git root directories in home folder
find ~ -type d -name .git
@quimic-gist
quimic-gist / drupal-install-fr.sh
Created December 11, 2014 09:49
Drupal: Download and install drupal in a specific language
# download latest drupal core
drush dl drupal
mv drupal-7.xx mysitedirectory
# download appropriate language files from http://ftp.drupal.org/files/translations/7.x/drupal and place them in mysitedirectory/profiles/standard/translations
# install in French
drush si --db-url=mysql://dbusername:dbpassword@localhost/dbname --db-su=name --db-su-pw=password --site-name="Your New Site" --locale=fr --account-name=siteadm1 --account-pass=siteadm1password --account-mail=admaddress@mail.com
# Add French and make default
@quimic-gist
quimic-gist / gist:7988125
Created December 16, 2013 14:46
Git:Clone repo into non empty directory
git clone --no-checkout repo-to-clone existing-dir/existing-dir.tmp # might want --no-hardlinks for cloning local repo
mv existing-dir/existing-dir.tmp/.git existing-dir/
rmdir existing-dir/existing-dir.tmp
cd existing-dir
git reset --hard HEAD # git thinks all files are deleted, this reverses that behaviour
@quimic-gist
quimic-gist / html5-start-page.html
Created December 13, 2013 16:26 — forked from jigante/html5-start-page.html
HTML: Html5 document structure
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
</body>
</html>