Skip to content

Instantly share code, notes, and snippets.

View zinovyev's full-sized avatar

Zinovyev Ivan zinovyev

View GitHub Profile
@lackac
lackac / .irbrc
Created September 7, 2011 08:10
Use Pry everywhere
require 'rubygems'
# This makes pry itself and all pry gems available
$LOAD_PATH.push(*Dir["#{ENV['HOME']}/.prygems/gems/*/lib"]).uniq!
begin
# Use Pry everywhere
require 'pry'
rescue LoadError => e
end
@jnx
jnx / rbenv-install-system-wide.sh
Created October 1, 2011 20:09
rbenv install and system wide install on Ubuntu 10.04 LTS.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
@liangzan
liangzan / .Xresources
Created January 19, 2012 23:26
Xresources for configuring urxvt
! urxvt
URxvt*buffered: true
URxvt*cursorBlink: true
URxvt*underlineColor: yellow
URxvt*font: xft:inconsolata:size=10:antialias=true
URxvt*depth: 32
URxvt*borderless: 1
URxvt*scrollBar: false
URxvt*loginShell: true
Urxvt*secondaryScroll: true # Enable Shift-PageUp/Down in screen
@marcusmalmberg
marcusmalmberg / CarrierWave.md
Last active June 14, 2021 23:22
Guide to setup CarrierWave which will upload a file to Amazon S3 in production environment and use local storage in development and test

CarrierWave home

https://github.com/jnicklas/carrierwave

This example will create an uploader that will upload a file stored in a model Model. The file will be stored locally in development and test environment and will use Amazon S3 in production.

CarrierWave installation

First add the gems.

@mapix
mapix / xinitrc
Created January 28, 2013 02:10
xinitrc for multi-monitor display in i3-wm
#!/bin/sh
#
# ~/.xinitrc
# Executed by startx (run your window manager from here)
# Set up screens and set background
if [ `xrandr | grep -c ' connected '` -eq 2 ]; then # dual-monitor
if [ `xrandr | grep VGA-1 | grep -c ' connected '` -eq 1 ]; then
xrandr --output LVDS-1 --auto --primary --output VGA-1 --auto --right-of LVDS-1
fi
@wteuber
wteuber / encrypt_decrypt.rb
Last active April 3, 2024 13:07
Simply encrypt and decrypt Strings in Ruby.
require 'openssl'
class String
def encrypt(key)
cipher = OpenSSL::Cipher.new('DES-EDE3-CBC').encrypt
cipher.key = Digest::SHA1.hexdigest key
s = cipher.update(self) + cipher.final
s.unpack('H*')[0].upcase
end
@ixxra
ixxra / school-wpa
Created October 10, 2013 15:17
Simple configuration for netctl to connect to a WPA2 network (@myschool)
Description='A wireless connection using a custom network block configuration'
Interface=wlp3s0
Connection=wireless
Security=wpa-configsection
IP=dhcp
WPAConfigSection=(
'ssid="university-ssid"'
'scan_ssid=1'
'key_mgmt=WPA-EAP'
'identity="username"'
@xboston
xboston / phalcon-events.list
Created December 24, 2013 19:08
Phalcon events:list
dispatch:beforeDispatchLoop
dispatch:beforeDispatch
dispatch:beforeNotFoundAction
dispatch:beforeExecuteRoute
dispatch:afterInitialize
dispatch:afterExecuteRoute
dispatch:afterDispatch
dispatch:afterDispatchLoop
dispatch:beforeException
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 5, 2024 04:52
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@kugaevsky
kugaevsky / datetime.ru.yml
Created September 3, 2014 14:17
Datetime Russian i18n for Ruby on Rails
ru:
date:
formats:
# Форматы указываются в виде, поддерживаемом strftime.
# По умолчанию используется default.
# Можно добавлять собственные форматы
#
#
# Use the strftime parameters for formats.
# When no format has been given, it uses default.