As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.
| sass/ | |
| | | |
| |– base/ | |
| | |– _reset.scss # Reset/normalize | |
| | |– _typography.scss # Typography rules | |
| | ... # Etc… | |
| | | |
| |– components/ | |
| | |– _buttons.scss # Buttons | |
| | |– _carousel.scss # Carousel |
| cmd /c ""C:\Program Files (x86)\Git\bin\bash.exe" --login -i -- H:\Daily_Reports\yesterdayTogglReport.sh" |
Many different applications claim to support regular expressions. But what does that even mean?
Well there are lots of different regular expression engines, and they all have different feature sets and different time-space efficiencies.
The information here is just copied from: http://regular-expressions.mobi/refflavors.html
I really liked @tjvantoll article Handling Failed HTTP Responses With fetch(). The one thing I found annoying with it, though, is that response.statusText always returns the generic error message associated with the error code. Most APIs, however, will generally return some kind of useful, more human friendly message in the body.
Here's a modification that will capture this message. The key is that rather than throwing an error, you just throw the response and then process it in the catch block to extract the message in the body:
fetch("/api/foo")
.then( response => {
if (!response.ok) { throw response }
return response.json() //we only get here if there is no error
})
Sources: http://stackoverflow.com/questions/1753070/git-ignore-files-only-locally
The .git/info/exclude file has the same format as any .gitignore file. Another option is to set core.excludesFile to the name of a file containing global patterns.
Note, if you already have unstaged changes you must run the following after editing your ignore-patterns:
git update-index --assume-unchanged [<file>...]
Note on $GIT_DIR: This is a notation used all over the git manual simply to indicate the path to the git repository. If the environment variable is set, then it will override the location of whichever repo you're in, which probably isn't what you want.
| <?php | |
| function require_auth() { | |
| $AUTH_USER = 'admin'; | |
| $AUTH_PASS = 'admin'; | |
| header('Cache-Control: no-cache, must-revalidate, max-age=0'); | |
| $has_supplied_credentials = !(empty($_SERVER['PHP_AUTH_USER']) && empty($_SERVER['PHP_AUTH_PW'])); | |
| $is_not_authenticated = ( | |
| !$has_supplied_credentials || | |
| $_SERVER['PHP_AUTH_USER'] != $AUTH_USER || | |
| $_SERVER['PHP_AUTH_PW'] != $AUTH_PASS |
The connection failed because by default psql connects over UNIX sockets using peer authentication, that requires the current UNIX user to have the same user name as psql. So you will have to create the UNIX user postgres and then login as postgres or use sudo -u postgres psql database-name for accessing the database (and psql should not ask for a password).
If you cannot or do not want to create the UNIX user, like if you just want to connect to your database for ad hoc queries, forcing a socket connection using psql --host=localhost --dbname=database-name --username=postgres (as pointed out by @meyerson answer) will solve your immediate problem.
But if you intend to force password authentication over Unix sockets instead of the peer method, try changing the following pg_hba.conf* line:
from
| #!/usr/bin/env python | |
| import sys | |
| import subprocess | |
| diff_requirements = 'git diff ORIG_HEAD HEAD --exit-code -- requirements.txt' | |
| exit_code = subprocess.call(diff_requirements.split()) | |
| if exit_code == 1: | |
| print 'The requirements file has changed! Remember to install new dependencies.' | |
| else: |