First, Lets find out what version of PHP we're running (To find out if it's the default version).
To do that, Within the terminal, Fire this command:
which php
| function targetBlank() { | |
| // remove subdomain of current site's url and setup regex | |
| var internal = location.host.replace("www.", ""); | |
| internal = new RegExp(internal, "i"); | |
| var a = document.getElementsByTagName('a'); // then, grab every link on the page | |
| for (var i = 0; i < a.length; i++) { | |
| var href = a[i].host; // set the host of each link | |
| if( !internal.test(href) ) { // make sure the href doesn't contain current site's host | |
| a[i].setAttribute('target', '_blank'); // if it doesn't, set attributes |
| function string_to_slug (str) { | |
| str = str.replace(/^\s+|\s+$/g, ''); // trim | |
| str = str.toLowerCase(); | |
| // remove accents, swap ñ for n, etc | |
| var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;"; | |
| var to = "aaaaeeeeiiiioooouuuunc------"; | |
| for (var i=0, l=from.length ; i<l ; i++) { | |
| str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i)); | |
| } |
To be able to use PHP5 PDO with MS Access mdb files the following is required
(the same applies for the PHP4 style of using odbc_X except for the
obviously PDO specific requirements):
In Linux this is achieved by intalling the php5-odbc package:
| App configuration in environment variables: for and against | |
| For (some of these as per the 12 factor principles) | |
| 1) they are are easy to change between deploys without changing any code | |
| 2) unlike config files, there is little chance of them being checked | |
| into the code repo accidentally | |
| 3) unlike custom config files, or other config mechanisms such as Java |
| // include the AMQPlib Classes || use an autoloader | |
| // queue/exchange names | |
| $queueRightNow = 'right.now.queue'; | |
| $exchangeRightNow = 'right.now.exchange'; | |
| $queueDelayed5sec = 'delayed.five.seconds.queue'; | |
| $exchangeDelayed5sec = 'delayed.five.seconds.exchange'; | |
| $delay = 5; // delay in seconds | |
Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.
In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.
Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
| var express = require('express'), | |
| app = express(), | |
| cookieParser = require('cookie-parser'), | |
| session = require('express-session'), | |
| RedisStore = require('connect-redis')(session); | |
| app.use(express.static(__dirname + '/public')); | |
| app.use(function(req, res, next) { | |
| if (~req.url.indexOf('favicon')) | |
| return res.send(404); |