Skip to content

Instantly share code, notes, and snippets.

({
block : 'page',
title : 'grid',
head : [
{elem: 'css', url: '_grid.css'}
],
scripts: [{elem: 'js', url: '_grid.js'}],
content: [
{
block : 'content',
@un1ko85
un1ko85 / fonts.styl
Last active August 29, 2015 14:18 — forked from diogomoretti/fonts.styl
// 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'),
@un1ko85
un1ko85 / site.conf
Last active August 29, 2015 14:22 — forked from paskal/site.conf
# 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
@un1ko85
un1ko85 / sm-annotated.html
Created October 27, 2015 08:49 — forked from hdragomir/sm-annotated.html
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<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);
<?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'])) {
<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
/* REMOVE SELF PINGING */
function remove_self_pinging(&$links,&$pung) {
$self = get_option('siteurl');
foreach ($links as $link => $data) {
if (false !== strpos($link,$self))
unset($links[$link]);
}
}
add_action('pre_ping','remove_self_pinging',0,2);
/* END REMOVE SELF PINGING */
@un1ko85
un1ko85 / new_gist_file.php
Created May 6, 2013 15:00
default wp-config.php and why WP_UPLOAD_PATH and WP_UPLOAD_URL are logical constants
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
@un1ko85
un1ko85 / new_gist_file
Created May 9, 2013 06:52
Git: extract branch name in post update hook But if branch was deleted (for example by git push origin :branch-name), you will receive errors from this command, so I think it’s safer to use another method: As post-update hook receives branch’s path as first parameter (something like refs/heads/branch-name), you can extract the branch name using …
branch=$(git rev-parse --symbolic --abbrev-ref $1)
branch=$(echo $1 | awk -F'/' '{print $3}')
if [ ! -f $1 ]; then
echo "Branch $branch was deleted! Do something then.."
else
echo "Branch $branch was updated! Do something then.."
fi
@un1ko85
un1ko85 / new_gist_file.sh
Created May 10, 2013 06:52
git hooks per branch
if [ `git rev-parse --abbrev-ref HEAD` == "development" ]; then
echo "development-script"
elif [ `git rev-parse --abbrev-ref HEAD` == "staging" ]; then
echo "staging-script"
elif [ `git rev-parse --abbrev-ref HEAD` == "production" ]; then
echo "production-script"
fi