Skip to content

Instantly share code, notes, and snippets.

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

Aleksey Kurepin foxweb

🏠
Working from home
View GitHub Profile
rake aborted!
ActiveAdmin::DatabaseHitDuringLoad: Your file, app/models/subscription_type.rb (line 22), caused a database error while Active Admin was loading. This is most common when your database is missing or doesn't have the latest migrations applied. To prevent this error, move the code to a place where it will only be run when a page is rendered. One solution can be, to wrap the query in a Proc.Original error message: PG::UndefinedTable: ERROR: relation "subscription_types" does not exist
LINE 5: WHERE a.attrelid = '"subscription_types"'::re...
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"subscription_types"'::regclass
AND a.attnum > 0 AND NOT a.attis
#!/bin/sh
sudo apt-get install mc
sudo apt-get install zsh
sudo usermod -s /bin/zsh root
sudo usermod -aG sudo $USER
sudo apt-get install git-core
sudo apt-get install wget
sudo apt-get install curl
sudo apt-get install whois
/*==========================================================================
The LCD connection is the same as Nokia LCD5110 and is a“8 Bit Pant Demo“
Just for ElecFreaks TFT01-2.2SP, which use SPI serial port and 240x320 pixel.
The driver is ILI9341.
by Elecfreaks
==========================================================================*/
#include "pins_arduino.h"
=> Booting Unicorn
=> Rails 3.2.14 application starting in development on http://0.0.0.0:9030
=> Call with -d to detach
=> Ctrl-C to shutdown server
listening on addr=0.0.0.0:9030 fd=12
worker=0 spawning...
master process ready
worker=0 spawned pid=9845
worker=0 ready
SIGWINCH ignored because we're not daemonized
# Russian. Updated 2012-07-18
ru:
admin:
home:
name: "Главная"
pagination:
previous: "« Предыдущая"
next: "Следующая »"
truncate: "…"
curl -v --cookie 'session=e66b90aca2e01a3798687ea027918cbb' -X POST 'http://localhost:9292/faye' -H 'Content-Type: application/json' \
-d '{"channel": "/meta/handshake", "supportedConnectionTypes": ["long-polling", "websocket"], "version": "1.0"}'
require 'faye'
require 'eventmachine'
require 'awesome_print'
ENDPOINT = 'http://localhost:9292/faye'
SESSION_ID = 'c50a4c8d2129896d6f2855bbc013d201'
CHANNEL = '/chat/new'
system('clear')
# Linux + Ruby 1.9.2, 1000 iterations
user system total real
(1) erb 0.680000 0.000000 0.680000 ( 0.810375)
(1) erubis 0.510000 0.000000 0.510000 ( 0.547548)
(1) fast erubis 0.530000 0.000000 0.530000 ( 0.583134)
(1) slim 4.330000 0.020000 4.350000 ( 4.495633)
(1) haml 4.680000 0.020000 4.700000 ( 4.747019)
(1) haml ugly 4.530000 0.020000 4.550000 ( 4.592425)
(2) erb 0.240000 0.000000 0.240000 ( 0.235896)
# gem install sys-proctable
# gem install awesome_print
require 'sys/proctable'
require 'awesome_print'
include Sys
# Return the results as an array of ProcTableStructs
a = ProcTable.ps
a.each do |p|

Введение

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