Skip to content

Instantly share code, notes, and snippets.

View alexkravets's full-sized avatar

Oleksandr Kravets alexkravets

View GitHub Profile
@alexkravets
alexkravets / blog_filters.rb
Created January 2, 2012 08:51
Custom Tags & Filters for LocomotiveCMS
module Locomotive
module Liquid
module Filters
# Module with custom filters
module Blog
# Creates a list of tags from a tags string, tags separated by comma
def tags(tags_string)
tags_string.split(', ').collect{|t| '<li><a href="/blog/tags/'+t+'" title="'+t.capitalize+'">'+t+'</a></li>'}.join()
@alexkravets
alexkravets / Youtube.js
Last active December 16, 2015 09:58
This is a Sencha Touch component to support Youtube videos and have no issues with scrolling. It also supports youtube thumbs if `thumb` config paramer is missing.
// This is a Sencha Touch component to support Youtube videos
// and have no issues with scrolling. It also supports youtube
// thumbs if `thumb` config paramer is missing.
/* Include this in index.html to load YT Api library:
<script>
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
@alexkravets
alexkravets / x-youtube.scss
Created April 18, 2013 22:07
SCSS for the Sencha Youtube component (https://gist.github.com/alexkravets/5416594) to support play overlay and some styling.
.x-youtube {
&:after { content: '';
display: block;
position: absolute;
width:100%;
height:100%;
background: url('../images/youtube-play@2x.png') no-repeat center;
background-size: 58px 58px;
}
@alexkravets
alexkravets / video.coffee
Created May 22, 2013 05:55
Showdown extension for Youtube videos
#
# Youtube iFrame Extension
#
window.Showdown.extensions.video = (converter) ->
[
{
type : 'lang',
regex : '\\^\\^([\\S]+)',
replace : (match, url) ->
youtube = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/
@alexkravets
alexkravets / server.js
Created June 1, 2013 15:26
Localhost web server in a few lines using Node.js and Connect.
var connect = require("connect");
var app = connect()
.use(connect.logger('dev'))
.use(connect.static('www'))
.listen(3000);
@alexkravets
alexkravets / mkmf.log
Created July 12, 2013 03:51
log from nokogiri 1.6.0 installation
package configuration for libxslt is not found
package configuration for libxml-2.0 is not found
package configuration for libiconv is not found
find_header: checking for libxml/parser.h... -------------------- yes
"gcc-4.2 -o conftest -I/Users/akravets/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/x86_64-darwin12.4.0 -I/Users/akravets/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0/ruby/backward -I/Users/akravets/.rvm/rubies/ruby-2.0.0-p247/include/ruby-2.0.0 -I. -I/Users/akravets/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri-1.6.0/ports/i686-apple-darwin11/libxml2/2.8.0/include/libxml2 -I/Users/akravets/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri-1.6.0/ports/i686-apple-darwin11/libxml2/2.8.0/include -I/Users/akravets/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri-1.6.0/ports/i686-apple-darwin11/libxslt/1.1.26/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I/Users/akravets/.rvm/usr/include -I/Users/akravets/.rvm/usr/include -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter
@alexkravets
alexkravets / dock_on_the_right.txt
Last active December 21, 2015 08:39
Specification for the Dock on the right feature for Elementary OS.
Idea behind this change is pretty simple. By default in Mac OS and Elementary the application doc is placed on the bottom of the screen. To me it looks like not optimal position and maybe obsolete. Reason for that is most of now-a-days screens are wide. Most used application is web browser. Dock on the bottom makes browser window big in width but small in height and that looks a disproportional.
<max visible website height> = <screen height> -
<top panel height> -
<window title height> -
<tab bar height> -
<address bar height> -
<dock height>
<max visible website width> = <max screen width>
Verifying my Blockstack ID is secured with the address 1EL4G6M6y6orcFParQR677B9isUXV9k2Mx https://explorer.blockstack.org/address/1EL4G6M6y6orcFParQR677B9isUXV9k2Mx