Skip to content

Instantly share code, notes, and snippets.

View Zhomart's full-sized avatar
🏠
Working from home

Zhomart Mukhamejanov Zhomart

🏠
Working from home
View GitHub Profile
/*
The Wheel Game
--------------
- There are three contestants: A, B, C. A plays first, then B, then C.
- Each contestant's score is determined by the sum of three spins of a wheel.
- Each spin is a number from 5 to 100, intervals of 5, ie. 5, 10, 15, 20, ... , 95, 100
{
"HOSTNAME"=>"ee62e5e58142",
"WAT"=>"YAY",
"LANG"=>"en_US.UTF-8",
"SHLVL"=>"3",
"HOME"=>"/app",
"RAILS_ENV"=>"production",
"RACK_ENV"=>"production",
"PATH"=>"/app/vendor/bundle/ruby/2.0.0/bin:/app/bin:/app/vendor/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"GEM_PATH"=>"",
@Zhomart
Zhomart / gist:11276452
Created April 25, 2014 02:54
mpd building error with gcc-4.9
$ brew reinstall -v mpd --cc=gcc-4.9 2>&1
==> Reinstalling mpd with --with-yajl, --with-lastfm
rm /usr/local/bin/mpd
rm /usr/local/share/man/man5/mpd.conf.5
rm /usr/local/share/man/man1/mpd.1
rm /usr/local/share/doc/mpd
==> Downloading http://www.musicpd.org/download/mpd/0.18/mpd-0.18.9.tar.xz
Already downloaded: /Library/Caches/Homebrew/mpd-0.18.9.tar.xz
==> Verifying mpd-0.18.9.tar.xz checksum
@Zhomart
Zhomart / gist:11277557
Created April 25, 2014 04:18
brew --config
$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: b06306181f9ce958e04a7c5697ddbfb11a14c750
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit ivybridge
OS X: 10.9.2-x86_64
Xcode: 5.1.1
CLT: 5.1.0.0.1.1396320587
@Zhomart
Zhomart / gist:11277585
Created April 25, 2014 04:20
brew doctor
$ brew doctor
Warning: gettext files detected at a system prefix
These files can cause compilation and link failures, especially if they
are compiled with improper architectures. Consider removing these files:
/usr/local/include/libintl.h
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
@Zhomart
Zhomart / gist:11277613
Created April 25, 2014 04:22
mpd/02.make
$ cat ~/Library/Logs/Homebrew/mpd/02.make
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-am
g++-4.9 -DHAVE_CONFIG_H -I. -DNDEBUG -I./src -D_REENTRANT -isystem /usr/local/Cellar/glib/2.40.0/include/glib-2.0 -isystem /usr/local/Cellar/glib/2.40.0/lib/glib-2.0/include -isystem /usr/local/opt/gettext/include -DSYSTEM_CONFIG_FILE_LOCATION='"/usr/local/Cellar/mpd/0.18.9/etc/mpd.conf"' -I/usr/local/Cellar/fluid-synth/1.1.6/include -I/usr/local/Cellar/ffmpeg/2.2.1/include -std=gnu++0x -g -O2 -fvisibility=hidden -fno-threadsafe-statics -fmerge-all-constants -fno-exceptions -fno-rtti -ffast-math -ftree-vectorize -ffunction-sections -fdata-sections -Wall -Wextra -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings -Wsign-compare -c -o src/libdecoder_plugins_a-DecoderBuffer.o `test -f 'src/DecoderBuffer.cxx' || echo './'`src/DecoderBuffer.cxx
g++-4.9 -DHAVE_CONFIG_H -I. -DNDEBUG -I./src -D_REENTRANT -isystem /usr/local/Cellar/glib/2.40.0/include/glib-2.0 -isystem
@Zhomart
Zhomart / rpc.rb
Last active August 29, 2015 14:00
Consumer#cancel doesn't work inside subscribe block
require 'bunny'
require 'json'
puts Bunny::VERSION # => 1.2.1
bunny_config = {
log_level: :debug
}
connection = Bunny.new bunny_config
$ ruby a.rb
1.2.1
D, [2014-04-28T20:03:13.097850 #95992] DEBUG -- #<Bunny::Session:2156599120 [email protected]:5672, vhost=/>: Sent protocol preamble
D, [2014-04-28T20:03:13.098368 #95992] DEBUG -- #<Bunny::Session:2156599120 [email protected]:5672, vhost=/>: Sent connection.start-ok
D, [2014-04-28T20:03:13.098532 #95992] DEBUG -- #<Bunny::Session:2156599120 [email protected]:5672, vhost=/>: Heartbeat interval negotiation: client = server, server = 580, result = 580
I, [2014-04-28T20:03:13.098570 #95992] INFO -- #<Bunny::Session:2156599120 [email protected]:5672, vhost=/>: Heartbeat interval used (in seconds): 580
D, [2014-04-28T20:03:13.098809 #95992] DEBUG -- #<Bunny::Session:2156599120 [email protected]:5672, vhost=/>: Sent connection.tune-ok with heartbeat interval = 580, frame_max = 131072, channel_max = 65535
D, [2014-04-28T20:03:13.098965 #95992] DEBUG -- #<Bunny::Session:2156599120 [email protected]:5672, vhost=/>: Sent connection.open with vhost = /
D, [2014-04-28T20:03:13.099046 #95992] DEBUG -- #<Bunny::Sess
@Zhomart
Zhomart / stacktrace
Created June 17, 2014 00:05
stack trace example
Started GET "/Di%c5%ef%bf%bd-f%c4%b1r%c3%a7as%c4%b1" for 127.0.0.1 at 2014-06-16 17:04:32 -0700
ActionController::RoutingError (No route matches [GET] "/Di%c5%ef%bf%bd-f%c4%b1r%c3%a7as%c4%b1"):
actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.0) lib/rails/rack/logger.rb:21:in `block in call'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `tagged'
MapIt: f797294d: [3, 3, 92, 7, 2, 98, 2, 99, 27, 2, 2, 22, 5, 45, 94, 0, 8, 1, 33, 0, 29] ...
MapIt: bfe2bc45: [85, 74, 91, 24, 22, 83, 62, 25, 99, 99, 59, 27, 4, 48, 59, 59, 43, 4, 85, 18, 0] ...
MapIt: 4e4006af: [28, 37, 94, 7, 4, 57, 11, 8, 99, 51, 65, 91, 16, 12, 17, 61, 64, 33, 16, 34, 53] ...
Analysis 2014-07-03 01:28:45 -0700
= Statsample::Reliability
== Reliability Analisis
Summary for Reliability Analisis
+------------------------------+--------------------+
| Valid Items | 3 |
| Valid cases | 136 |