Skip to content

Instantly share code, notes, and snippets.

View juev's full-sized avatar
🏠
Working from home

Evsyukov Denis juev

🏠
Working from home
View GitHub Profile
@juev
juev / gist:1409252
Created November 30, 2011 14:31 — forked from al3xandru/gist:1128606
nvALT Bookmarklet
javascript:(function({
var INSTAPAPER=true,w=window,d=document,pageSelectedTxt=w.getSelection?w.getSelection():(d.getSelection)?d.getSelection():(d.selection?d.selection.createRange().text:0),pageTitle=d.title,pageUri=w.location.href,tmplt="";
tmplt="From ["+pageTitle+"]("+pageUri+"):\n\n";
if(pageSelectedTxt!="") {
pageSelectedTxt=">%20"+pageSelectedTxt;
pageSelectedTxt=pageSelectedTxt.replace(/(\r\n|\n+|\r)/gm,"\n");
pageSelectedTxt=pageSelectedTxt.replace(/\n/g,"\n>%20\n>%20");
w.location.href="nvalt://make/?txt="+encodeURIComponent(tmplt+pageSelectedTxt)+"&title="+encodeURIComponent(pageTitle)
}
else {
@juev
juev / gist_tag.rb
Created December 3, 2011 18:41 — forked from imathis/gist_tag.rb
A Liquid tag for Jekyll sites that allows embedding Gists and showing code for non-JavaScript enabled browsers and readers.
require 'cgi'
require 'digest/md5'
require 'net/https'
require 'uri'
module Jekyll
class GistTag < Liquid::Tag
def initialize(tag_name, text, token)
super
@text = text
@juev
juev / jammit_generator.rb
Created December 3, 2011 18:46
Jammit plugin for Jekyll
require "jammit"
module Jekyll
class JammitGenerator < Generator
safe true
def generate(site)
jammit_config = site.config["jammit_config"] || "_assets.yml"
jammit_base_dir = site.config["jammit_base_dir"] || File.join(".", site.config["source"])
jammit_output_dir = site.config["jammit_output_dir"] || "assets"
@juev
juev / Rakefile
Created January 5, 2012 11:54 — forked from stammy/Rakefile
dirty hack of a rakefile I use to upload new images to cloudfront for jekyll blog posts
# when I write new blog posts I usually have a temporary folder called new_post on my desktop
# that I place images I want to upload to amazon s3 (which is distributed as CF) and then
# get the appropriate URLs to put the images in my blog post
# I usually save files as some_slug.png and some_slug_1200.png
# with the latter being a larger version (1200px wide) of the first.
# a typical upload will include 20 files. 2 versions of some (sm and lg), and some orphans
# so this compares filenames and if it detects a larger version of a file,
# it links the the smaller image to the larger image (i use fancyzoom on my site)
# if not, it just links to the image
@juev
juev / blogspot_to_jekyll.rb
Created January 15, 2012 08:03 — forked from kennym/blogspot_to_jekyll.rb
Migrate your blogger blog posts to jekyll.
#!/usr/bin/env ruby
#
# Convert blogger (blogspot) posts to jekyll posts
#
# Basic Usage
# -----------
#
# ./blogger_to_jekyll.rb feed_url
#
# where `feed_url` can have the following format:
@juev
juev / Folder Preferences
Created January 22, 2012 15:36 — forked from chrisyour/Folder Preferences
Show hidden files and hidden folders (except .git) in your TextMate project drawer
# Want to show hidden files and folders in your TextMate project drawer? Simple, just modify the file and folder patterns in TextMate's preferences.
# Instructions:
# Go to TextMate > Preferences...
# Click Advanced
# Select Folder References
# Replace the following:
# File Pattern
@juev
juev / hack.sh
Created March 31, 2012 11:26 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@juev
juev / slim-html5-boilerplate
Created June 5, 2012 10:19 — forked from blakehilscher/slim-html5-boilerplate
Slim HTML5 Boilerplate
doctype html
/[if lt IE 7]
html.no-js.ie6.oldie lang="en"
/[if IE 7]
html.no-js.ie7.oldie lang="en"
/[if IE 8]
html.no-js.ie8.oldie lang="en"
/[if gte IE 8]
html.no-js lang="en"
head
@juev
juev / texmate_dot_filter
Created June 7, 2012 18:59 — forked from bru/texmate_dot_filter
TextMate dotfiles filter
# TextMate dotfiles filter
# use this filter in Preferences -> Advanced -> Folder References -> File Pattern
# to show .gitignore, .gems (useful for Heroku), .bundle in your project
!(/\.(?!(htaccess|gitignore|gems|bundle))[^/]*|\.(tmproj|o|pyc)|/Icon\r|/svn-commit(\.[2-9])?\.tmp)$
@juev
juev / excerpt.rb
Created July 5, 2012 13:19 — forked from stympy/excerpt.rb
Jekyll excerpt plugin
# This goes in _plugins/excerpt.rb
module Jekyll
class Post
alias_method :original_to_liquid, :to_liquid
def to_liquid
original_to_liquid.deep_merge({
'excerpt' => content.match('<!--more-->') ? content.split('<!--more-->').first : nil
})
end
end