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) {
@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 {