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
<script>console.log({"block":"page","elem":null,"mix":{"0":{"block":"user","elem":null,"mix":null,"content":null,"tag":null,"html":null,"js":{"logged":true,"profile_url":"http:\/\/vrukodelii.dev\/users\/unic","avatar_url":"http:\/\/vrukodelii.dev\/attachments\/avatar_small.png","menu":[{"icon":"user","url":"http:\/\/vrukodelii.dev\/users\/unic","name":"Mo\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u044c"},{"icon":"edit","url":"http:\/\/vrukodelii.dev\/users\/unic\/posts","name":"Mo\u0438 \u0440\u0430\u0431\u043e\u0442\u044b"},{"icon":"settings","url":"http:\/\/vrukodelii.dev\/my\/settings","name":"Mo\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438"},{"icon":"user","url":"http:\/\/vrukodelii.dev\/admin","name":"\u0410\u0434\u043c\u0438\u043d\u043a\u0430"},{"icon":"power-off","url":"http:\/\/vrukodelii.dev\/logout","name":"\u0412\u044b\u0439\u0442\u0438"}]},"jsAttr":null,"bem":null,"cls":null,"attrs":null,"_stop":false,"_matcherCalls":0,"_m":[]}},"content":{"0":{"block":"header","elem":null,"mix":n |
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 | |
return function ($bh) { | |
$bh->match('breadcrumbs', function ($ctx, $json) { | |
if (!$ctx->param('data')) { | |
return; | |
} | |
foreach ($json->data as $item) { | |
$mod = isset($item['active']) ? true : false; | |
if (isset($item['url'])) { |
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
<script type="text/javascript"> | |
(function () { | |
"use strict"; | |
// once cached, the css file is stored on the client forever unless | |
// the URL below is changed. Any change will invalidate the cache | |
var css_href = './index_files/web-fonts.css'; | |
// a simple event handler wrapper | |
function on(el, ev, callback) { | |
if (el.addEventListener) { | |
el.addEventListener(ev, callback, false); |
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
# read more at https://terrty.net/2014/ssl-tls-in-nginx/ | |
# latest version on https://gist.github.com/paskal/628882bee1948ef126dd/126e4d1daeb5244aacbbd847c5247c2e293f6adf | |
# security test score: https://www.ssllabs.com/ssltest/analyze.html?d=terrty.net | |
# your nginx version might not have all directives included, test this configuration before using in production against your nginx: | |
# $ nginx -c /etc/nginx/nginx.conf -t | |
server { | |
# public key, contains your public key and class 1 certificate, to create: | |
# (example for startssl) | |
# $ (cat example.com.pem & wget -O - https://www.startssl.com/certs/class1/sha2/pem/sub.class1.server.sha2.ca.pem) | tee -a /etc/nginx/ssl/domain.pem > /dev/null |
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
// Fonts mixin | |
font-url(file) | |
return '../fonts/' + file | |
webfont(family, file, hack-chrome-windows = false, weight = 'normal') | |
@font-face | |
font-family family | |
src url(font-url(file + '.eot')) | |
src url(font-url(file + '.eot?#iefix')) format('embedded-opentype'), | |
url(font-url(file + '.woff')) format('woff'), |
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
({ | |
block : 'page', | |
title : 'grid', | |
head : [ | |
{elem: 'css', url: '_grid.css'} | |
], | |
scripts: [{elem: 'js', url: '_grid.js'}], | |
content: [ | |
{ | |
block : 'content', |
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
add_action( 'phpmailer_init', 'wpse8170_phpmailer_init' ); | |
function wpse8170_phpmailer_init( PHPMailer $phpmailer ) { | |
$phpmailer->Host = 'your.smtp.server.here'; | |
$phpmailer->Port = 25; // could be different | |
$phpmailer->Username = 'your_username@example.com'; // if required | |
$phpmailer->Password = 'yourpassword'; // if required | |
$phpmailer->SMTPAuth = true; // if required | |
// $phpmailer->SMTPSecure = 'ssl'; // enable if required, 'tls' is another possible value | |
$phpmailer->IsSMTP(); |
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 127.0.0.1:80; | |
server_name nocache.domain.tld; | |
location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|js|swf|txt|ico)$ { | |
allow 127.0.0.1; | |
deny all; | |
root /path/to/fuse/filesystem; | |
} | |
} |
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 { | |
[...] | |
set $cache_uri $request_uri; | |
# POST requests and urls with a query string should always go to PHP | |
if ($request_method = POST) { | |
set $cache_uri 'null cache'; | |
} | |
if ($query_string != "") { | |
set $cache_uri 'null cache'; |
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
$.getJSON('https://graph.facebook.com/fql?q=select like_count, share_count from link_stat where url="' + encodeURI(page_url) + '"' | |
+ '&callback=?', function(response) { | |
var count = 0; | |
if (response.data !== undefined) { | |
if (response.data[0].like_count !== undefined) { | |
count += response.data[0].like_count; | |
} | |
if (response.data[0].share_count !== undefined) { | |
count += response.data[0].share_count; | |
} |