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
server { | |
listen portnumber; | |
server_name ip_address; | |
location / { | |
root /var/www/mywebsite.com; | |
index index.html index.htm; | |
auth_basic "Restricted"; #For Basic Auth | |
auth_basic_user_file /etc/nginx/.htpasswd; #For Basic Auth | |
} | |
} |
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. Get apache utils: | |
sudo apt-get install apache2-utils | |
2. Create .htpasswd file and make up a username (one-liner) | |
sudo htpasswd -c /etc/nginx/.htpasswd exampleuser | |
3. You will be prompted to enter a new password | |
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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
*/ | |
$args = array( |
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
function wp_api_encode_acf($data,$post,$context){ | |
$data['meta'] = array_merge($data['meta'],get_fields($post['ID'])); | |
return $data; | |
} | |
if( function_exists('get_fields') ){ | |
add_filter('json_prepare_post', 'wp_api_encode_acf', 10, 3); | |
} |
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
function wp_api_encode_acf($data,$post,$context){ | |
$data['meta'] = array_merge($data['meta'],get_fields($post['ID'])); | |
return $data; | |
} | |
if( function_exists('get_fields') ){ | |
add_filter('json_prepare_post', 'wp_api_encode_acf', 10, 3); | |
} |
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
@mixin hw-accelerate { | |
-webkit-transform: translate3d(0, 0, 0); | |
-webkit-backface-visibility: hidden; | |
-webkit-perspective: 1000; | |
transform: translate3d(0, 0, 0); | |
backface-visibility: hidden; | |
} |
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
var fs = require('fs'); | |
fs.readFile('cats.txt', function(err, data) { | |
if(err) throw err; | |
var array = data.toString().split("\n"); | |
var lookup = array.map(function(line) { | |
var significant = line.split('. ')[1].split(' ('); | |
return { category: significant[0], id: significant[1].split(')')[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
var addNth = (function () { | |
var len, i = 0, className, prevIndexes = []; | |
function isNew (el) { | |
return el.hasClass(className); // removed unnecessary parenthesis | |
} | |
return function (selector, html, nth, className ) { | |
var els = $( selector ); | |
className = className || 'test'; |
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
var styles = window.getComputedStyle(document.documentElement, ''); |
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
function getWatchers(root) { | |
root = angular.element(root || document.documentElement); | |
var watcherCount = 0; | |
function getElemWatchers(element) { | |
var isolateWatchers = getWatchersFromScope(element.data().$isolateScope); | |
var scopeWatchers = getWatchersFromScope(element.data().$scope); | |
var watchers = scopeWatchers.concat(isolateWatchers); | |
angular.forEach(element.children(), function (childElement) { | |
watchers = watchers.concat(getElemWatchers(angular.element(childElement))); |
OlderNewer