This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Specify -R if recursion is required | |
chmod u+rwX,go+rX * | |
# 664, 775 | |
chmod ug+rwX,go+rX * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule ^(.*)$ public/$1 [L] | |
</IfModule> | |
# In case you have to place all files in your root folder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Move to the beginning of file | |
gg | |
-- Delete everything | |
dG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName cliffly.local | |
DirectoryIndex index.html index.php | |
DocumentRoot "/path/to/web" | |
<Directory "/path/to/web"> | |
Order allow,deny | |
Allow from all | |
Require all granted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diskpart | |
listdisk | |
select disk 3 (or enter the corresponding drive number for external HDD) | |
clean all | |
create partition primary | |
select partition 1 | |
active | |
format fs=ntfs quick | |
assign | |
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. ++Math.PI | |
2. (0.1 + 0.2) + 0.3 == 0.1 + (0.2 + 0.3) | |
3. typeof NaN | |
4. typeof typeof undefined | |
5. a = {null:null}; typeof a.null; | |
6. a = "5"; b = "2"; c = a * b; | |
7. a = "5"; b = 2; c = a+++b; | |
8. isNaN(1/null) | |
9. (16).toString(16) | |
10. 016 * 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
git config --global alias.dc 'diff --color' | |
git config --global alias.dca 'diff --color --cached' | |
git config --global alias.pr 'pull --rebase' | |
git config --global alias.st 'status' | |
git config --global alias.aa 'add . -A' | |
git config --global alias.ca 'commit --amend' | |
git config --global alias.cm 'commit' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "hashicorp/precise32" | |
config.vm.synced_folder "./", "/var/www", id: "vagrant-root", | |
owner: "vagrant", | |
group: "www-data", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check existence of a property | |
Object.prototype.hasOwnProperty.call(obj, keyToBeChecked); | |
// Create a new object that inherits from a null prototype | |
var registry = Object.create(null); | |
// So this could yield `true` | |
!registry['hasOwnProperty']; | |
// Source: http://www.devthought.com/2012/01/18/an-object-is-not-a-hash/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const slugify = str => str | |
.trim() | |
.toLowerCase() | |
.replace(/(á|à|ả|ã|ạ|â|ấ|ầ|ẩ|ậ|ă|ằ|ắ|ặ|ẳ|ẵ)/g, 'a') | |
.replace(/(é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ)/g, 'e') | |
.replace(/(ó|ò|ỏ|õ|ọ|ơ|ờ|ớ|ở|ợ|ỡ|ô|ố|ồ|ổ|ộ)/g, 'o') | |
.replace(/(í|ì|ỉ|ĩ|ị)/g, 'i') | |
.replace(/(ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ự)/g, 'u') | |
.replace(/(ý|ỳ|ỷ|ỹ|ỵ)/g, 'y') | |
.replace(/(đ)/g, 'd') |
OlderNewer