//http://dsheiko.com/weblog/my-lovely-mac-os-x-web-development-environment ###loaded from /private/etc/apache2/extra/httpd-vhosts.conf which is loaded by main conf file <Virtualhost *:80> VirtualDocumentRoot "/Users/jasper/webdesign/%1" ServerName vhosts.dev ServerAlias *.dev UseCanonicalName Off LogFormat "%V %h %l %u %t "%r" %s %b" vcommon ErrorLog "/Users/jasper/webdesign/vhosts-error_log"
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
[{"key":"1920 x 1080","name":"Nexus 5 Landscape","width":1920,"height":1080}, | |
{"key":"1080 x 1920","name":"Nexus 5 Portrait","width":1080,"height":1920}, | |
{"key":"1024 x 768","name":"iPad Landscape","width":1024,"height":768}, | |
{"key":"768 x 1024","name":"iPad Portrait","width":768,"height":1024}, | |
{"key":"736 x 414","name":"iPhone 6 Plus Landscape","width":736,"height":414}, | |
{"key":"414 x 736","name":"iPhone 6 Plus Portrait","width":414,"height":736}, | |
{"key":"667 x 375","name":"iPhone 6 Landscape","width":667,"height":375}, | |
{"key":"375 x 667","name":"iPhone 6 Portrait","width":750,"height":1334}, | |
{"key":"568 x 320","name":"iPhone 5/S/C Landscape","width":568,"height":320}, | |
{"key":"320 x 568","name":"iPhone 5/S/C Portrait","width":320,"height":568}, |
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
//Do not forget to add user to group Apache as well to prevent other issues with server uploaded content | |
//add existing user to group x keeping user's first group as primary | |
# usermod -a -G apache user | |
//Make Apache and Mod PHP create files with group write permissions | |
//see http://stackoverflow.com/questions/428416/setting-the-umask-of-the-apache-user | |
root ~]$ echo "umask 002" >> /etc/sysconfig/httpd | |
[root ~]$ service httpd restart | |
// Set Group ID where user will create content to make it belong to group directory is in. | |
//Useful to allow Mod PHP to run scripts | |
chmod g+s /path/to/directory/ |
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
//http://haydenjames.io/analyze-websites-ttfb-time-first-byte/ | |
//should be below a second | |
curl -o /dev/null -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" http://site.com |
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
curl -O -L https://www.dropbox.com/s/x/file.zip |
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.19.2 is version on OSX Yeosemite. The file is used to make sure stop words are filtered out | |
//https://unix.stackexchange.com/questions/41479/find-n-most-frequent-words-in-a-file | |
tr -c '[:alnum:]' '[\n*]' < file.txt | fgrep -v -f /usr/share/groff//1.19.2/eign | sort | uniq -c | sort -nr | head -10 |
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
sudo rm -rf \ /opt/local \ /Applications/DarwinPorts \ /Applications/MacPorts \ /Library/LaunchDaemons/org.macports.* \ /Library/Receipts/DarwinPorts*.pkg \ /Library/Receipts/MacPorts*.pkg \ /Library/StartupItems/DarwinPortsStartup \ /Library/Tcl/darwinports1.0 \ /Library/Tcl/macports1.0 \ ~/.macports |
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
<?php | |
eval( | |
function get_page($url){ | |
//start cURL session with url $url | |
$ch = curl_init (); | |
curl_setopt ($ch, CURLOPT_URL,$url); | |
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt ($ch, CURLOPT_TIMEOUT, 30); | |
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0); | |
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0); |
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
ErrorDocument 401 default | |
AuthType Basic | |
AuthName "Enter login two times and then regular password" | |
AuthUserFile /home/user/domain.com/.htpasswd | |
Require valid-user |