Making scripts run at boot time with Debian
update-rc.d blah defaults
where "blah" is the init.d file name. make sure to set "blah"s permissions to 755 as well.
Related cards:
wrap a JavaScript method with a different method
You can wrap a JavaScript method with another method by utilizing the apply()
method and arguments
property inside a function.
function wrapMethod(method) {
var args = [];
for(var i = 1; i < arguments.length; i++) {
if...
Disable jQuery animations during Rails tests
If you have Capybara tests in your project, you might run into sparatic test failures where elements are not available in a state that you think they will be in because of jQuery animations that occur on the elements.
You can add the following to...
passing optional arguments in JavaScript
You can call a JavaScript object while passing an array of arguments with the method apply
.
given:
function method(arg1, arg2){
console.log([arg1, arg2]);
}
you can use:
method.apply(this, ['one', 'two']);
JavaScript apply() method's context could be important
The apply() method takes two arguments, the context to run the method as, and an array of arguments to pass to the method. If using this
does not give you the results you need, try passing the object chain above the method you are calling.
na...
list installed applications on Mac
You can see a list of all installed applications on your Mac by running the following command in Terminal:
mdfind 'kMDItemContentTypeTree == com.apple.application' | sort
Update a Wordpress site url
There are a couple methods available to change the url of a WordPress site from an old address to a new one without having to manually dig through a database dump.
You can either add some code to your config.php file or your theme's functions.php...
php error_reporting(-1)
error_reporting(-1) at the top of your script during dev to turn on all warnings, notices, etc in all versions of PHP