Skip to content

Instantly share code, notes, and snippets.

Avatar
🦀

Sergei Silnov kumekay

🦀
View GitHub Profile
@kumekay
kumekay / redbutton.css
Created Oct 24, 2012
Красная кнопка Октопус-ДВ
View redbutton.css
.btn-red {
background-color: hsl(360, 100%, 36%) !important;
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#f40000", endColorstr="#b70000");
background-image: -khtml-gradient(linear, left top, left bottom, from(#f40000), to(#b70000));
background-image: -moz-linear-gradient(top, #f40000, #b70000);
background-image: -ms-linear-gradient(top, #f40000, #b70000);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f40000), color-stop(100%, #b70000));
background-image: -webkit-linear-gradient(top, #f40000, #b70000);
background-image: -o-linear-gradient(top, #f40000, #b70000);
@kumekay
kumekay / loco_editor_install
Created Nov 27, 2012
gem install locomotive_editor -v 1.0.0.rc15 --debug
View loco_editor_install
gem install locomotive_editor -v 1.0.0.rc15 --debug
Exception `NameError' at /home/ku/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:177 - uninitialized constant Gem::Commands::InstallCommand
Exception `Errno::EAGAIN' at /home/ku/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/net/protocol.rb:141 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /home/ku/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/net/protocol.rb:141 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /home/ku/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/net/protocol.rb:141 - Resource temporarily unavailable - read would block
Exception `Errno::EEXIST' at /home/ku/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/fileutils.rb:247 - File exists - /home/ku/.gem/specs/modules.locomotivecms.com%80
Exception `Errno::EAGAIN' at /home/ku/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/net/protocol.rb:141 - Resource temporarily unavailable - read would block
Exception `Errn
@kumekay
kumekay / ard.pde
Last active Dec 15, 2015
Мастер класс Ардуино
View ard.pde
import processing.serial.*;
import cc.arduino.*;
Arduino arduino;
void setup() {
size(512, 512);
arduino = new Arduino(this, Arduino.list()[0], 57600);
}
View address_decorator.rb
Deface::Override.new(:name => "remove billing address form",
:virtual_path => "spree/checkout/_address",
:remove => "#billing[data-hook]"
)
Deface::Override.new(:name => "remove use billing address checkbox",
:virtual_path => "spree/checkout/_address",
:remove => "[data-hook='use_billing']"
)
@kumekay
kumekay / capture_and_copy.bat
Last active Dec 18, 2015
Web-camera auto shot every minute and copy it to dropbox + web page to see it
View capture_and_copy.bat
:sleep
ping 127.0.0.1 -n %1 -w 1000 > NUL
:top
set time_stamp=%DATE:~0,2%%DATE:~3,2%%DATE:~6,4%_%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%
"C:\Program Files (x86)\VideoLAN\VLC\vlc" --dshow-vdev="Logitech HD Webcam C510" --dshow-size=1280x720 --dshow-aspect-ratio=16\:9 -V dummy --intf=dummy --dummy-quiet --video-filter=scene --no-audio --scene-path=F:\cherem --scene-format=jpeg --scene-prefix=%time_stamp% --scene-replace --run-time=1 --scene-ratio=24 "dshow://" vlc://quit
copy f:\cherem\%time_stamp%.jpeg c:\users\ku\Dropbox\Public\cherem.jpg
CALL :sleep 60
goto top
@kumekay
kumekay / .htaccess
Created Jun 26, 2013
http simple auth apache
View .htaccess
<Location />
AuthType Basic
AuthName " Test Environment"
AuthUserFile '/path/pass'
Require valid-user
</Location>
@kumekay
kumekay / Error log
Created Aug 18, 2013
LocomotiveCMS 2.2.2 Multisite
View Error log
/home/ku/.rvm/gems/ruby-2.0.0-p247@neokul/gems/locomotive_cms-2.2.2/lib/locomotive.rb:98:in `configure_multi_sites': undefined method `domain' for true:TrueClass (NoMethodError)
from /home/ku/.rvm/gems/ruby-2.0.0-p247@neokul/gems/locomotive_cms-2.2.2/lib/locomotive.rb:49:in `after_configure'
from /home/ku/.rvm/gems/ruby-2.0.0-p247@neokul/gems/locomotive_cms-2.2.2/lib/locomotive.rb:42:in `configure'
from /home/ku/Dropbox/neokul/config/initializers/locomotive.rb:1:in `<top (required)>'
from /home/ku/.rvm/gems/ruby-2.0.0-p247@neokul/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:245:in `load'
from /home/ku/.rvm/gems/ruby-2.0.0-p247@neokul/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:245:in `block in load'
from /home/ku/.rvm/gems/ruby-2.0.0-p247@neokul/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:236:in `load_dependency'
from /home/ku/.rvm/gems/ruby-2.0.0-p247@neokul/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:245:in `load'
from /home/ku/.rvm/
View cron
Крон в линуксе запускает программу в пустом окружении. Учитывая, что
сегодня каждое первое приложение идет с rvm или чем-то ещё, а крон обычно
запускается по ночам, отладка занимает кучу времени.
Проще всего отладить так:
env -i /path/to/script.sh
Это воссоздает то бедное окружение, в котором работает крон.
View 0. nginx_setup.sh
# Nginx+Unicorn best-practices congifuration guide. Now with SPDY!
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
#
# Deployment structure
#
# SERVER:
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)
#