To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> High Sierra
<?php namespace Cavedwellerrich\MyPackage; | |
use Illuminate\Support\ServiceProvider; | |
use Illuminate\Foundation\AliasLoader; | |
class MyPackageServiceProvider extends ServiceProvider { | |
//... | |
public function register() |
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
function insertAt(arr, val, i) { | |
arr.splice(i, 0, val); | |
} | |
function removeAt(arr, i) { | |
return arr.splice(i, 1).length === 1; | |
} | |
function genericInsertAt(arr, val, i) { | |
Array.prototype.splice.call(arr, i, 0, val); | |
} |
Sometimes you want to have a subdirectory on the master
branch be the root directory of a repository’s gh-pages
branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master
branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist
.
Remove the dist
directory from the project’s .gitignore
file (it’s ignored by default by Yeoman).
#!/bin/bash | |
echo "Generating an SSL private key to sign your certificate..." | |
openssl genrsa -des3 -out myssl.key 1024 | |
echo "Generating a Certificate Signing Request..." | |
openssl req -new -key myssl.key -out myssl.csr | |
echo "Removing passphrase from key (for nginx)..." | |
cp myssl.key myssl.key.org | |
openssl rsa -in myssl.key.org -out myssl.key |
timer('2011-12-31', function(timeRemaining) { | |
console.log('Timer 1:', timeRemaining); | |
}); | |
// This will run every minute, instead of every second | |
timer('2012-12-31', function(timeRemaining) { | |
console.log('Timer 2:', timeRemaining); | |
}, 60000); |