Skip to content

Instantly share code, notes, and snippets.

@sumskyi
sumskyi / task.js
Last active March 22, 2025 10:43 — forked from nechaido/task.js
task.js
const data = `city,population,area,density,country
Shanghai,24256800,6340,3826,China
Delhi,16787941,1484,11313,India
Lagos,16060303,1171,13712,Nigeria
Istanbul,14160467,5461,2593,Turkey
Tokyo,13513734,2191,6168,Japan
Sao Paulo,12038175,1521,7914,Brazil
Mexico City,8874724,1486,5974,Mexico
London,8673713,1572,5431,United Kingdom
New York City,8537673,784,10892,United States
@sumskyi
sumskyi / alias_matchers.md
Created January 30, 2025 19:32 — forked from JunichiIto/alias_matchers.md
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
{
"app/models/*.rb": {
"command": "model",
"affinity": "model",
"alternate": ["unit/models/%s_spec.rb", "spec/models/%s_spec.rb"],
"related": "db/schema.rb#%p",
"template": "class %S\nend"
},
"spec/factories/*_factory.rb": {
# sudo ln -s ~/nginx.conf unicorn.conf
upstream app_server {
server unix:/tmp/unicorn_padrino.sock fail_timeout=0;
}
server {
listen 80;
charset utf-8;
server_name db.innshine.com;

Введение

Начать стоит отсюда. Не пугайтесь то, что это книга по незнакомой 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

@sumskyi
sumskyi / 42-things.md
Created November 28, 2012 18:01 — forked from xdite/42-things.md
Ten (42) Things You Didn't Know Rails Could Do
@sumskyi
sumskyi / Gemfile
Created April 18, 2012 16:10
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin
@sumskyi
sumskyi / node-and-npm-in-30-seconds.sh
Created November 22, 2011 12:19 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://npmjs.org/install.sh | sh
Feature: When a user associates social network accounts with their postpone.it account
Background:
Given I am a new, authenticated user
Then I go to the accounts page
Scenario: User can authorize Facebook
Then I should see "Facebook (0)"
And we authorize with "Facebook"
Then I should have been authorized with "Facebook"
And I should see "Facebook (1)"
class << Marshal
def load_with_rails_classloader(*args)
begin
load_without_rails_classloader(*args)
rescue ArgumentError, NameError => e
if e.message =~ %r(undefined class/module)
const = e.message.split(' ').last
const.constantize
retry
else