Skip to content

Instantly share code, notes, and snippets.

View zvlex's full-sized avatar

Aleksandre Zutikov zvlex

View GitHub Profile
@zvlex
zvlex / xorg.conf
Created July 25, 2013 13:50
xorg.conf for LG FLATRON L1953S - GeForce 7300 GT
Section "Device"
Identifier "Default Device"
Option "NoLogo" "True"
Driver "nvidia"
Option "metamodes" "1280x1024_60 +0+0; 1024x768_60 +0+0; 800x600_60 +0+0; 640x480_60 +0+0"
EndSection
@zvlex
zvlex / gist:6595130
Created September 17, 2013 14:32
Google.ru search plugin
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">
<os:ShortName>Google.ru</os:ShortName>
<os:Description>Google Russia</os:Description>
<os:InputEncoding>utf-8</os:InputEncoding>
<os:Image width="16" height="16">data:image/x-icon;base64,R0lGODlhEAAQAPfLAAATVikwdA8SnxUfgAsWpAAilholjxw4jBc7kwAlvQQ2sRMsoBUqqhMzuhY/vxw4tSgmiyM1mSUztiQ6sTE3sQ4qyxMxxRoyxiAuxR1CtBxJsBxasSJuuTFguBte0Rlf2xVc9h9W9xVjzxVr0gdj6BRh4R1o5yBcyiZbyydT1i9b2Ddb1iFY6CJg2Vpor1dzvEJu20Z0yi23QDy1REi2OUy0O1WzOVC4PU+tVUe5Sk2xQU2zRUO4UE21Ula2SmKEqWWF2HyPx2+a6X6e6Xqk1m+s78sUDs4UGdEQB9YfDdwaANEfHd0YEscjAM4mAM0qANIoD9IkGdslGswuItYgL4aP0ImP2YGZ36Opzaq2wq/S+rzX/7/e8MrS1MLO/sTb48rT8snX/83c89PZ+crq+cH1/9Dl/9Ln/93r/9fy/+Hf7P/42eDm/O7u/+T29uX2/eT2/+f4/+f5/+j/9u//8+3/9u7/9ur5/+j//+n//+v//u3//+7//e7//+////b66/T/6vX/6/f/7f/07fj/4fv/4Pj/5v/45v7/4/r+7/3/6fDw+Pfx//D/9/X/8fT/8/f/8ff/8/D///H///L8/fL///P///X7//b6/ff/+/T///b9//f///v19//w9v/09P/29v/x+f/y///z///1+v/1///2///3//j79P/58/z/8/z99/z/9v7/9P7/9vn7//
@zvlex
zvlex / gist:9749839
Created March 24, 2014 21:43
Generate SHA256 hash & UUID in Ruby
# Generate SHA256 hash
require 'digest'
Digest::SHA256.hexdigest "your_string"
# Generate UUID
SecureRandom.uuid.split('-').join
@zvlex
zvlex / application.rb
Created April 30, 2014 10:00
/lib/tasks/ckeditor.rake
config.autoload_paths += %W(#{config.root}/app/models/ckeditor)
config.assets.precompile += Ckeditor.assets
config.assets.precompile += %w(ckeditor/*)
@zvlex
zvlex / Rakefile
Created May 22, 2014 17:59
Jekyll-s rake post:new
namespace :post do
desc 'create a new jekyll post'
task :new do
title = ENV['title']
time = Time.now
slug = "#{time.strftime("%Y-%m-%d")}#{title.downcase.gsub(/[^\w]+/, '-')}"
file = File.join(
File.dirname(__FILE__),
'_posts',
# This snippet shows how TokenAuthenticatable works in Devise today.
# In case you want to maintain backwards compatibility, you can ditch
# devise's token mechanism in favor of this hand-rolled one. If not,
# it is recommended to migrate to the mechanism defined in the following
# snippet (2_safe_token_authenticatable.rb).
#
# In both snippets, we are assuming the User is the Devise model.
class User < ActiveRecord::Base
# You likely have this before callback set up for the token.
before_save :ensure_authentication_token
doctype html
/[if lt IE 7]
| <html class="ie6">
/[if IE 7]
| <html class="ie7">
/[if IE 8]
| <html class="ie8">
/[if IE 9]
| <html class="ie9">
| <!--[if (gte IE 9)|!(IE)]<!--> <html> <!--<![endif]-->
@zvlex
zvlex / Preferences.sublime-settings
Last active August 29, 2015 14:06
Ruby build system for sublime text 2, utf-8 fixed.
{
"default_encoding": "UTF-8",
"tab_size": 2,
"translate_tabs_to_spaces": true,
"theme": "Soda Dark.sublime-theme",
"soda_folder_icons": true,
"ignored_packages":
[
"Vintage"
],
{
"cmd": ["/home/zvlex/.rvm/bin/rvm-auto-ruby", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.ruby"
}
@zvlex
zvlex / rename.sh
Created September 22, 2014 07:14
Rename all *.txt to *.text
# Rename all *.txt to *.text
for f in *.txt; do
mv -- "$f" "${f%.txt}.text"
done