Skip to content

Instantly share code, notes, and snippets.

View ognevsky's full-sized avatar

Andrey Ognevsky ognevsky

View GitHub Profile
@ognevsky
ognevsky / prices_and_volumes
Created May 3, 2020 17:22
SPY 2020-04-29 weird price/volumes
UTC Time: Price => Size (Volume)
12:00: 285.73 => 1
12:00: 285.73 => 1
13:02: 285.73 => 1
14:15: 285.73 => 1
14:15: 285.73 => 1
14:15: 285.73 => 1
14:15: 285.73 => 1
14:42: 285.7312 => 7031
15:15: 285.73 => 1

Введение

Начать стоит отсюда. Не пугайтесь то, что это книга по незнакомой OS, эти термины практически везде одинаковые и здесь они изложены в понятной для начинающих форме.

http://www.qnx.com/developers/docs/6.4.1/neutrino/getting_started/s1_procs.html

Прочесть нужно треть главы до подраздела "Starting a process", если С не пугает, читайте полностью. После прочтения вы будете понимать, что такое process, thread, mutex, priorites, semaphores, scheduler, contex-switch, kernel states.

Ruby

bind "\e[A" ed-search-prev-history
bind "\e[B" ed-search-next-history

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@ognevsky
ognevsky / bootstrap.rb
Created December 3, 2012 13:08
Passportist Bootstrap Application
gem 'passportist'
gem 'rails_config'
generate 'rails_config:install'
remove_file('config/settings/development.yml')
create_file('config/settings/development.yml') do
<<-EOF
passport:
url: 0.0.0.0:3000
#!/usr/bin/env bash
apt-get install -y curl ruby rubygems1.8
gem install chef ruby-shadow --no-ri --no-rdoc
@ognevsky
ognevsky / install_puppet_mac.sh
Created September 24, 2012 23:13 — forked from rija/install_puppet_mac.sh
Installing Puppet on Mac OS X
#!/usr/bin/env bash
set -o errtrace
set -o errexit
facter_version=$1
puppet_version=$2
target_volume=$3
@ognevsky
ognevsky / gist:1437660
Created December 6, 2011 10:17 — forked from avalanche123/gist:981817
GitHub Emoji
:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb:
@ognevsky
ognevsky / dnsd.rb
Created December 3, 2011 09:37 — forked from peterc/dnsd.rb
Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# By Peter Cooper
#
# MIT license
#
# * Not advised to use in your production environment! ;-)
# * Requires Ruby 1.9
# * Supports A and CNAME records
# * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance
# * All records get the same TTL
@ognevsky
ognevsky / gist:1170670
Created August 25, 2011 13:34
TMail Ruby 1.9.2 installation error
Installing tmail (1.2.3.1) with native extensions /Users/elfxf/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:551:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/Users/elfxf/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
creating Makefile
make
gcc-4.2 -I. -I/Users/elfxf/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/x86_64-darwin11.1.0 -I/Users/elfxf/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/Users/elfxf/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -fno-common -pipe -D_FILE_OFFSET_BITS=64 -o tmailscanner.o -c tmailscanner.c
tmailscanner.c:19:16: error: re.h: No such file or directory
tmailscanner.c: In function 'mails_s_new':
tmailscanner.c:75: error: 'struct RStri