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:3124344
Created July 16, 2012 18:57 — forked from saetia/gist:1623487
Clean Install – Mountain Lion OS X 10.8 DP3 Update 4
@juev
juev / pinboard-backup.sh
Created July 28, 2012 14:41
Pinboard backup
#!/bin/sh
DIR=/Users/sbrown/backups
FILE=`date +"%Y%m%d"`-pinboard-backup.json
URL=https://USERNAME:PASSWORD@api.pinboard.in/v1/posts/all?format=json
cd $DIR
wget $URL -O $FILE
@juev
juev / anonymous_class.rb
Created August 8, 2012 09:36 — forked from smtalim/anonymous_class.rb
Anonymous Class
# Here are some ways by which you can define an anonymous class
# 1
class Rubyist
def self.who
"Geek"
end
end
# 2
@juev
juev / rbenv-howto.md
Created August 19, 2012 09:34 — forked from MicahElliott/rbenv-howto.md
Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.

TL;DR Demo

# Ensure system is in ship-shape.

aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev

@juev
juev / gist:3462610
Created August 25, 2012 08:41 — forked from jrochkind/gist:2161449
A Capistrano Rails Guide

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

@juev
juev / .htaccess
Created December 2, 2012 10:44 — forked from bhollis/.htaccess
Serving pre-gzipped assets from Apache
AddEncoding gzip .gz
RewriteEngine on
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{HTTP_USER_AGENT} !Konqueror
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule ^(.*)\.css$ $1.css.gz [QSA,L]
RewriteRule ^(.*)\.js$ $1.js.gz [QSA,L]
RewriteRule ^(.*)\.html$ $1.html.gz [QSA,L]
@juev
juev / itunes.clj
Created January 6, 2013 17:42 — forked from fogus/itunes.clj
(defn itunes [command]
(let [mgr (javax.script.ScriptEngineManager.)
engine (.getEngineByName mgr "AppleScript")]
(.eval engine (str "tell application \"iTunes\" to " command))))
(itunes 'pause)
(itunes 'play)
(itunes 'stop)
;; ...
{% if page.title %}<meta property="og:title" content="{{ page.title }}" /><meta itemprop="name" content="{{ page.title }}" />{% endif %}
{% if page.author %}<meta name="author" content="{{ site.author }}" />
<meta property="article:author" content="https://plus.google.com/+JeremyMorgan" />
<meta property="og:type" content="article" />{% endif %}
{% if page.date %}<meta property="article:published_time" content="{{ page.date }}" />{% endif %}
{% capture category %}{% if page.categories %}{{ page.categories }}{% endif %}{% endcapture %}
{% if page.categories %}<meta property="article:section" content="{{ page.categories }}" />{% endif %}
{% capture description %}{% if page.description %}{{ page.description }}{% else %}{{ content | raw_content }}{% endif %}{% endcapture %}
<meta name="description" content="{{ description | strip_html | condense_spaces | truncate:150 }}" />
<meta property="og:description" content="{{ description | strip_html | condense_spaces | truncate:150 }}" />
#!/usr/bin/env ruby
# 1. export your RIL bookmarks
# 2. save this file to the same directory where your ril_export.html is
# 3. change username and password in the script bellow
# 4. run 'ruby ril_to_instapaper.rb' in terminal
require "cgi"
require "net/http"
require "net/https"
@juev
juev / Rakefile
Created April 14, 2013 07:06 — forked from albrow/Rakefile
# ...
desc "Deploy website to s3/cloudfront via aws-sdk"
task :s3_cloudfront => [:generate, :minify, :gzip, :compress_images] do
puts "=================================================="
puts " Deploying to Amazon S3 & CloudFront"
puts "=================================================="
# setup the aws_deploy_tools object
config = YAML::load( File.open("_config.yml"))