Skip to content

Instantly share code, notes, and snippets.

View yas375's full-sized avatar

Victor Ilyukevich yas375

  • Walmart Global Tech
  • Seattle, WA
  • 01:28 (UTC -07:00)
View GitHub Profile
@yas375
yas375 / gist:f9e44d7761859e0dc7e4
Created December 4, 2014 08:32
Decimal separators in different locales
NSMutableDictionary *knownSeparators = [NSMutableDictionary dictionary];
[[NSLocale availableLocaleIdentifiers] bk_each:^(NSString *identifier) {
NSLocale *locale = [NSLocale localeWithLocaleIdentifier:identifier];
NSString *separator = [locale objectForKey:NSLocaleDecimalSeparator];
NSMutableArray *localeIdentifiers = knownSeparators[separator];
if (localeIdentifiers == nil) {
localeIdentifiers = [NSMutableArray array];
knownSeparators[separator] = localeIdentifiers;
Steps
1. Sign up on the web using Facebook.
2. During Sign up there is an option to edit what info should be available for OpenTable.
3. The email is optional there. Disable it.
4. Finish sign up process
Expected: I'm signed in.
Result: an alert saying I've got 500 error. Try to sign in - 500 error again.
@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