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
@henrik
henrik / .htaccess
Created April 18, 2009 23:15
Insane mod_rewrite gymnastics for my blog setup.
RewriteEngine On
# Map http://henrik.nyh.se to /jekyll.
RewriteRule ^$ /jekyll/ [L]
# Map http://henrik.nyh.se/x to /jekyll/x unless there is a x in the web root.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/jekyll/
RewriteRule ^(.*)$ /jekyll/$1
namespace :tags do
task :generate do
puts 'Generating tags...'
require 'rubygems'
require 'jekyll'
include Jekyll::Filters
options = Jekyll.configuration({})
site = Jekyll::Site.new(options)
site.read_posts('')
desc 'Generate tags page'
task :tags do
puts "Generating tags..."
require 'rubygems'
require 'jekyll'
include Jekyll::Filters
options = Jekyll.configuration({})
site = Jekyll::Site.new(options)
site.read_posts('')
@markoa
markoa / wordpressxml2jekyll.rb
Created January 4, 2010 09:48
Script to export posts from a Wordpress XML file to Jekyll (Textile) files. Collects comments in a YAML file too.
#!/usr/bin/env ruby
# Input: WordPress XML export file.
# Outputs: a series of Textile files ready to be included in a Jekyll site,
# and comments.yml which contains all approved comments with metadata which
# can be used for a Disqus import.
require 'rubygems'
require 'hpricot'
require 'clothred'
#!/usr/bin/env ruby
# Input: WordPress XML export file.
# Outputs: a series of Textile files ready to be included in a Jekyll site,
# and comments.yml which contains all approved comments with metadata which
# can be used for a Disqus import.
# Changes from the original gist: http://gist.github.com/268428
# 1. Handles titles containing special characters. Those have to be YAML escaped
# 2. Use the original permalinks in wordpress.
@ssokolow
ssokolow / README.markdown
Created August 13, 2010 06:09
Wordpress WXR to Jekyll exporter

Having decided to move my blog to Jekyll, I went looking for solutions. AzizLight's class proved the simplest, but fell short of what I wanted.

This version has been modified to be runnable as a command-line script (help available via -h) and, aside from category permalink continuity (which I'm working on), produces a ready-to-use _posts directory for your Jekyll blog.

Full details on the changes are available in the git commit log.

@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@jmlacroix
jmlacroix / aws_cf_invalidate.rb
Created September 21, 2010 03:14 — forked from nbibler/amazon_cloudfront_invalidation.rb
Command line script to invalidate cloudfront objects
require 'rubygems'
require 'hmac-sha1'
require 'net/https'
require 'base64'
s3_access='S3_ACCESS_KEY'
s3_secret='S3_SECRET_KEY'
cf_distribution='CLOUDFRONT_DISTRIBUTION_ID'
if ARGV.length < 1
@objectoriented
objectoriented / aws_cf_invalidate.rb
Created September 28, 2010 17:37 — forked from jmlacroix/aws_cf_invalidate.rb
Ruby script to invalidate objects on Amazon's CloudFront CDN (shows status of recent requests also)
require 'rubygems'
require 'hmac-sha1' # on OS X: sudo gem install ruby-hmac
require 'net/https'
require 'base64'
#
# CHANGE ME: S3 access credentials go here, along with CloudFront Distribution ID
#
s3_access=''
s3_secret=''
@tpope
tpope / css.vim
Created January 2, 2011 05:42
Nikolai's fix to nested closing curly brace indenting
" Vim indent file
" Language: CSS
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2010-12-22
if exists("b:did_indent")
finish
endif
let b:did_indent = 1