Skip to content

Instantly share code, notes, and snippets.

View scodx's full-sized avatar
🏠
Working from home

Oscar Sánchez scodx

🏠
Working from home
View GitHub Profile
# rsync with exclude, add -n to it to simulate the process
rsync -av --progress --exclude='.git/' --exclude='.gitignore' --exclude='dist/' --exclude='node_modules/ ' ~/folder/where/ .
@scodx
scodx / gist:4183396ff90fa07980685506f5bd6348
Created May 11, 2018 13:26 — forked from snipe/gist:14752d829bd3490a2d0a
CALL TO UNDEFINED METHOD ILLUMINATE\COOKIE\COOKIEJAR::GET() in Laravel 4.2
Upgrade Sentry to v 2.1.*

You said Linux, so you luck out (at least it should be available, not sure when it was added):

diff --brief -r dir1/ dir2/

If you also want to see differences for files that may not exist in either directory:

diff --brief -Nr dir1/ dir2/

find . -name \*.swp -type f -delete
#!/bin/bash
#
# Variables
#
export COMMON_NAME="John Doe"
export ORGANIZATION="John Doe Organization"
export EMAIL_ADDRESS="[email protected]"
export DOMAIN_NAME="test-domain.dev"
export SUBJECT_ALT_NAME="DNS:${DOMAIN_NAME},DNS:*.${DOMAIN_NAME}"
@scodx
scodx / my.cnf
Created November 10, 2017 06:49 — forked from fragje/my.cnf
Custom my.cnf for use with MAMP. Place this file in `/Application/MAMP/conf/` and restart MAMP
# Example MySQL config file for large systems.
#
# This is for a large system with memory = 512M where the system runs mainly
# MySQL.
#
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
# http://dev.mysql.com/doc/mysql/en/option-files.html
@scodx
scodx / clear-form.js
Created October 28, 2017 13:59
Clears a form (like reset). Be aware for input types that clear data used for the app logic, like hidden.
function clearForm(myFormElement) {
var elements = myFormElement.elements;
myFormElement.reset();
for(i=0; i<elements.length; i++) {
field_type = elements[i].type.toLowerCase();

Undo a commit and redo

git reset HEAD~

This leaves your working tree (the state of your files on disk) unchanged but undoes the commit and leaves the changes you committed unstaged (so they'll appear as "Changes not staged for commit" in git status, and you'll need to add them again before committing). If you only want to add more changes to the previous commit, or change the commit message1, you could use git reset --soft HEAD~ instead, which is like git reset HEAD~ but leaves your existing changes staged.

# ERROR: sudo: no tty present and no askpass program specified
sudo visudo
# or edit #includedir /etc/sudoers.d
username ALL = NOPASSWD: /fullpath/to/command, /fullpath/to/othercommand
# All applications:
# username ALL=(ALL) NOPASSWD: ALL
SET global log_output = 'FILE';
SET global general_log_file='/path/to/mysql_general.log';
SET global general_log = 1;