Skip to content

Instantly share code, notes, and snippets.

@dsaveliev
dsaveliev / gist:1210733
Created September 12, 2011 07:12
rake db:test:prepare
WARNING: 'task :t, arg, :needs => [deps]' is deprecated. Please use 'task :t, [args] => [deps]' instead.
at /srv/projects/mpro/r3/lib/tasks/city.rake:4
WARNING: 'task :t, arg, :needs => [deps]' is deprecated. Please use 'task :t, [args] => [deps]' instead.
at /srv/projects/mpro/r3/lib/tasks/fetch_tnt_video.rake:5
WARNING: Global access to Rake DSL methods is deprecated. Please include
... Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method Spec::Rake::SpecTask#task called at /srv/projects/mpro/r3/lib/tasks/rspec.rake:28:in `initialize'
WARNING: Global access to Rake DSL methods is deprecated. Please include
... Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method Spec::Rake::SpecTask#task called at /srv/projects/mpro/r3/lib/tasks/rspec.rake:28:in `initialize'
@dsaveliev
dsaveliev / gist:1211951
Created September 12, 2011 18:07
resolver
Started GET "/twitter/auth/twitter-mobile/f8a8d6a630246998ce61a6cf2ec10aa134af4537/images/sprites/logo-home.gif?proxied_domain=http%3A%2F%2Fa3.twimg.com" for 192.168.10.23 at Mon Sep 12 22:06:20 +0400 2011
Processing by Twitter::AuthController#show as HTML
Parameters: {"other"=>"twitter-mobile/f8a8d6a630246998ce61a6cf2ec10aa134af4537/images/sprites/logo-home.gif", "proxied_domain"=>"http://a3.twimg.com"}
[Mon Sep 12 22:06:20 +0400 2011][79263527557][]: USER_INFO: {"region_name"=>"Москва", "op_name"=>"ОАО 'Мегафон' Столичный филиал", "utc_offset"=>nil, "town_name"=>"Москва", "region_id"=>"34", "to_num"=>"79269999999", "op_id"=>"96", "from_num"=>"79261000000", "town_id"=>"27612"}
MobileHttpApi. Request to: http://vmp.vasmedia.ru/?service=7123618276361&msisdn=79263527557&status=check
MobileHttpApi. Response: <?xml version="1.0" encoding="utf-8"?>
<subscriptions msisdn="79263527557">
<subscription>
<subscriptionId>undef</subscriptionId>
</subscription>
<script language="javascript">
function hideAllTabs() {
document.getElementById('content_customer').style.display = 'none';
document.getElementById('content_payment').style.display = 'none';
document.getElementById('content_shipping').style.display = 'none';
};
function pageCustomer() {
hideAllTabs();
document.getElementById('content_customer').style.display = 'block';
};
@dsaveliev
dsaveliev / gist:1230000
Created September 20, 2011 19:04
табы разметка
<div id="page_customer" class="button" onclick="javascript:pageCustomer();">
<div id="page_payment" class="button" onclick="javascript:pagePayment();">
<div id="page_shipping" class="button" onclick="javascript:pageShipping();">
(function() {
var __indexOf = Array.prototype.indexOf || function(item) {
for (var i = 0, l = this.length; i < l; i++) {
if (this[i] === item) return i;
}
return -1;
};
window.onload = function() {
var generateWorld, getDistance, getRange;
Crafty.cfg = {

Введение

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

@dsaveliev
dsaveliev / gbrt
Created September 15, 2013 20:49 — forked from Houdini/gbrt
#!/usr/bin/env ruby
def format_commit_info timestamp, time_desc, commit_id, message, ref_name
[
"#{timestamp.strftime("%y %b %d")}, #{timestamp.strftime("%l:%M%p").downcase}",
"(#{time_desc})",
commit_id,
message,
ref_name
]
# see http://stackoverflow.com/questions/5880962/how-to-destroy-jobs-enqueued-by-resque-workers - old version
# see https://github.com/defunkt/resque/issues/49
# see http://redis.io/commands - new commands
namespace :resque do
desc "Clear pending tasks"
task :clear => :environment do
queues = Resque.queues
queues.each do |queue_name|
puts "Clearing #{queue_name}..."