Skip to content

Instantly share code, notes, and snippets.

View aerohub's full-sized avatar

Pavel Kanyshev aerohub

  • St.Petersburg, Russia
View GitHub Profile
@aerohub
aerohub / google-custom-search-engine.js
Created December 26, 2017 06:11 — forked from artchen/google-custom-search-engine.js
Universal Search Google Custom Search Engine
/**
* Search by Google Custom Search Engine JSON API
* @param options : (object)
*/
var GoogleCustomSearch = function(options) {
SearchService.apply(this, arguments);
var self = this;
var endpoint = "https://www.googleapis.com/customsearch/v1";
/**
@aerohub
aerohub / formspree.html
Created April 8, 2017 19:55 — forked from jannecederberg/formspree.html
JS: Ajax send forms using the most excellent Formspree » http://formspree.io #snippet
<form id="contact-form" action="//formspree.io/your@email.com" method="post">
<input type="text" name="Name" placeholder="Name" required>
<input type="email" name="Email" placeholder="Email" required>
<textarea name="Message" cols="30" rows="6" placeholder="Message" required></textarea>
<!-- CONFIG -->
<input class="is-hidden" type="text" name="_gotcha">
<input type="hidden" name="_subject" value="Subject">
<input type="hidden" name="_cc" value="email@cc.com">
<!-- /CONFIG -->
<input class="submit" type="submit" value="Send">
@aerohub
aerohub / itunes-podcast-categories.yml
Created December 14, 2016 22:36 — forked from codeincontext/itunes-podcast-categories.yml
A list of the current iTunes podcast categories - in YAML format
- Arts:
- Design
- Fashion & Beauty
- Food
- Literature
- Performing Arts
- Spoken Word
- Visual Arts
- Business:
- Business News
@aerohub
aerohub / create_images_json_object_from_dir.js
Created October 10, 2016 21:27 — forked from joemccann/create_images_json_object_from_dir.js
Scan a directory and create a JSON object of images (and write it to a file) of all the images in that directory.
var sys = require("sys"),
fs = require("fs");
function processImageDir(path, outFilename, cb) {
fs.readdir(path, function(err, files) {
var imgfiles = [];
// Check for images and push on the array if it's a match.
files.forEach(function(name) {
Yes, you can achieve this without getting your hands dirty. Just add the actors in the front matter of any posts:
actors:
- Brad
- Matt
Then you can add post.actors to your theme, exactly the same as the default post.tags.
With the official theme landscape, just modify layout/article.ejs.
If you want to list all the actors of all the posts, you should check HEXO/lib/plugins/helper/list.js. It's not hard to implement a list_actors().
@aerohub
aerohub / _config.yml
Last active January 2, 2021 20:10
Hexo tag_map and category_map parameters in _config.yml file
# http://blog.konstantinpavlov.net/2015/01/17/hexo-useful-tips/
# If you want your tags and categories on your language and the URLs still look nice in ASCII,
# you may use tag_map and category_map parameters in _config.yml file of your blog.
# You can even set one URL prefix for two different tags.
tag_map:
tag1: supertag
по-русски: in-russian
fun: fun and jokes
jokes: fun and jokes
@aerohub
aerohub / hexo2hugo.sh
Created July 31, 2016 12:35 — forked from conoro/hexo2hugo.sh
Hexo to Hugo converter
# code is from http://helw.net/2015/07/19/migrating-to-hugo-from-hexo/
# Ran fine on Windows 10 with MSysGit installed
# cd to directory with all the md files from Hexo
# bash hexo2hugo.sh
---
# ensure dates don't start with single quotes
for file in *; do awk '{
if ($1 == "date:") {
gsub("\047", "", $0); print;
} else {