Skip to content

Instantly share code, notes, and snippets.

View yas375's full-sized avatar

Victor Ilyukevich yas375

  • Walmart Global Tech
  • Seattle, WA
  • 03:30 (UTC -07:00)
View GitHub Profile
@yas375
yas375 / forum.feature
Created October 24, 2010 09:45
simple forum test with cucumber
Feature: Forums
In order to manage forums
As an admin
I want to create a new forums
Background:
Given basic setup
Scenario: Viewing forums index by anonym
Given I am on the forum
@yas375
yas375 / Shipping methods
Created November 9, 2010 09:31
Calsulators for different shipping methods in spree-active-shipping
USPS Priority Mail
USPS Express Mail International
USPS Media Mail
FedEx International Priority
UPS Three-Day Select
FedEx Priority Overnight Saturday Delivery
FedEx International Economy
USPS Priority Mail Small Flat-Rate Box
FedEx 2 Day Freight
USPS Priority Mail Large Flat-Rate Box
@yas375
yas375 / Winstarter
Created November 22, 2010 09:33
I put this cript inton ~/bin/windows file
#!/bin/sh
# is zenity avaliable in the system?
which zenity > /dev/null
if [ $? -eq 1 ]
then
echo "Вы должны установить zenity для отрисовки диалогов этим скриптом."
echo -e "Сделать это можно выполнив: \033[1msudo apt-get install zenity\033[0m"
exit 1
fi
[ -f $HOME/.profile ] && . $HOME/.profile
HISTSIZE=1000
SAVEHIST=1000
HISTFILE=$HOME/.zsh_history
setopt append_history
setopt inc_append_history
setopt extended_history
setopt hist_find_no_dups
setopt hist_ignore_all_dups
@yas375
yas375 / README
Created December 30, 2010 12:24
Контролируемое скачивание файлов на rails 2 с nginx
Контролируемое скачивание файлов через rails 2 в связке с nginx.
Используется заголовок X-Accel-Redirect nginx'а, который делает так,
что файл отдаёт не приложение, а сам сервер, таким образом на приложение
меньше нагрузки.
Ссылки по теме:
http://groups.google.com/group/ror2ru/browse_thread/thread/1733088704f9278e -
обсуждение в группе ror2ru
http://wiki.nginx.org/XSendfile
@yas375
yas375 / gist:833715
Created February 18, 2011 14:30
xmonad config
--
-- xmonad example config file for xmonad-0.9
--
-- A template showing all available configuration hooks,
-- and how to override the defaults in your own xmonad.hs conf file.
--
-- Normally, you'd only override those defaults you care about.
--
-- NOTE: Those updating from earlier xmonad versions, who use
-- EwmhDesktops, safeSpawn, WindowGo, or the simple-status-bar
@yas375
yas375 / gist:982562
Created May 20, 2011 08:38
xorg.conf для моего старого компа для работы с моником
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection
Section "Files"
EndSection
@yas375
yas375 / create-local-svn-repo
Created September 29, 2011 14:55
script for creating local svn repo
#!/bin/sh
# create directory for svn repositories
mkdir -p $HOME/svn
# create initial_state if it's not exists
mkdir -p $HOME/svn/initial_state/trunk $HOME/svn/initial_state/branches $HOME/svn/initial_state/tags
echo 'creating new repository'
svnadmin create $HOME/svn/$1
@yas375
yas375 / TestCode.m
Created January 6, 2012 09:48
test `isEqual:`, `isEqualToArray:`, `==`
NSString *string1 = @"first string";
NSString *string2 = @"second string";
NSArray *array1 = [NSArray arrayWithObjects:string1, string2, nil];
NSArray *array2 = [NSArray arrayWithObjects:string1, string2, nil];
NSLog(@"(array1 == array2) => %d \n [array1 isEqualToArray:array2] => %d \n [array1 isEqual:array2] => %d",
(array1 == array2),
[array1 isEqualToArray:array2],
[array1 isEqual:array2]);
@yas375
yas375 / gist:1682162
Created January 26, 2012 10:34
example of using UIAutomation with tuneup_js
test("Initial screen", function(target, app) {
// check navigation bar
navBar = mainWindow.navigationBar();
assertEquals("Add Account", navBar.name());
button = navBar.leftButton();
assertEquals("Back", button.name());
// check tables
table = mainWindow.tableViews()[0];
tableGroup = table.groups()[0];