Skip to content

Instantly share code, notes, and snippets.

View ruslanosipov's full-sized avatar

Ruslan Osipov ruslanosipov

View GitHub Profile
@ruslanosipov
ruslanosipov / .tmux.conf
Created August 8, 2014 18:05
Configuration for tmux, good for use with Vim
# Use C-\ as a control sequence.
unbind-key C-b
set -g prefix 'C-\'
bind-key 'C-\' send-prefix
# Easy-to-remember split pane commands.
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
@ruslanosipov
ruslanosipov / rails_secure.rb
Created June 19, 2013 15:45
Rails server over SSL, do "bundle exec ruby scripts/rails_secure.rb server"
#!/usr/bin/env ruby
require 'rubygems' # if ruby 1.8.7
require 'rails/commands/server'
require 'rack'
require 'webrick'
require 'webrick/https'
module Rails
class Server < ::Rack::Server
def default_options
@ruslanosipov
ruslanosipov / default.html
Created November 4, 2018 22:23
wiki/templates/default.html
<html>
<head>
<link rel="Stylesheet" type="text/css" href="%root_path%style.css" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<title>%title%</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
.center {
margin-left: auto;
margin-right: auto;
@ruslanosipov
ruslanosipov / usrswitch
Created April 24, 2013 16:31
Little script that swaps local gitconfig files used in git version 1.7.10 and up (include.path ~/.gitconfig.local)
#!/usr/bin/env sh
# Ruslan Osipov, April 2013
# Little script that swaps local gitconfig files used in git version
# 1.7.10 and up (include.path ~/.gitconfig.local).
#
# Requirements:
# Little set_prompt function from
# https://github.com/ruslanosipov/dotfiles/blob/master/.bashrc
# ~/.gitconfig.local
@ruslanosipov
ruslanosipov / shgist.py
Created May 17, 2013 14:26
Gists downloader, add your token, chmod +x, add it to your path and do "shgist file" to download your gist
#!/usr/bin/env python
# Ruslan Osipov <ruslan@rosipov.com>
# Usage: shgist keywords
# Description: Gists downloader
import urllib
import urllib2
import sys
@ruslanosipov
ruslanosipov / wxr2txt.py
Created June 2, 2014 03:40
Script to convert WordPress posts to plain text files
#!/usr/bin/env python
"""This script converts WXR file to a number of plain text files.
WXR stands for "WordPress eXtended RSS", which basically is just a
regular XML file. This script extracts entries from the WXR file into
plain text files. Output format: article name prefixed by date for
posts, article name for pages.
Usage: wxr2txt.py filename [-o output_dir]