Skip to content

Instantly share code, notes, and snippets.

View nu7hatch's full-sized avatar

Krzysztof Kowalik nu7hatch

  • Warsaw, Poland
View GitHub Profile
▸ make
[ 25%] Building C object CMakeFiles/kosmonaut.dir/src/client.c.o
[ 50%] Building C object CMakeFiles/kosmonaut.dir/src/worker.c.o
[ 75%] Building C object CMakeFiles/kosmonaut.dir/src/utils.c.o
Linking C static library libkosmonaut.a
[ 75%] Built target kosmonaut
[100%] Building C object CMakeFiles/selftest.dir/src/selftest.c.o
Linking C executable selftest
Undefined symbols:
"_zsocket_close", referenced from:
goroutine 1103 [runnable]:
syscall.Syscall()
/home/nu7hatch/Dev/Open/go/src/pkg/syscall/asm_linux_amd64.s:30 +0x4b
syscall.Close(0xffffffff, 0x0, 0x0, 0x43c5e1)
/home/nu7hatch/Dev/Open/go/src/pkg/syscall/zsyscall_linux_amd64.go:182 +0x54
net.closesocket(0x2ffffffff, 0xf800000001, 0x4dd22c, 0xf800000003)
/home/nu7hatch/Dev/Open/go/src/pkg/net/fd.go:663 +0x23
net.socket(0x4dd22c, 0x7f5200000003, 0x100000002, 0xf800000000, 0x0, ...)
/home/nu7hatch/Dev/Open/go/src/pkg/net/sock.go:49 +0x1fb
net.internetSocket(0x4dd22c, 0xf800000003, 0x0, 0x0, 0xf8400220c0, ...)
Benchmarking bitmechanic.com:80 with 100 concurrent clients and 10 packets each:
Clients (done: 100, failed: 0), Packets (sent: 1000, lost: 0)
real 0m1.017s
user 0m0.043s
sys 0m0.072s
class CurrentUser::GuestBoxCell < CurrentUser::ProfileBoxCell
end
@nu7hatch
nu7hatch / gist:1395642
Created November 26, 2011 13:09
Preguntas webrocket
Quien es tu cliente?
Cual es tu propuesta de valor?
Cuales son tus fuentes de ingresos?
Cual es tu estructura de costos?
Quienes son tus principales socios/proveedores?
require 'spec_helper'
describe MessageObserver do
subject do
MessageObserver.instance
end
let :message do
Message.make! :content => "Hello World!"
end
class AuthProvider
include Mongoid::Document
field :provider, :type => String
field :uid, :type => String
belongs_to :user, :class_name => "User", :inverse_of => :providers
validates :uid, :presence => true, :uniqueness => { :scope => :provider }
validates :provider, :presence => true
...
chdir(P_tmpdir);
char path[MAXPATHLEN];
getcwd(path, MAXPATHLEN);
printf("%s\n", path); // => /private/var/tmp
printf("%s\n", P_tmpdir); // => /var/tmp
...
@nu7hatch
nu7hatch / app.rb
Created April 21, 2011 03:05
OmniAuth login in popup
require 'rubygems'
require 'sinatra'
require 'omniauth/oauth'
set :sessions, true
set :layout, true
use OmniAuth::Builder do
provider :twitter, 'key', 'secret'
end
bla bla bla...
...
gcc -Ivm/external_libs/llvm/include -I/home/nu7hatch/.rvm/src/rbx-1.1.0-20100923/vm/external_libs/llvm/include -I/home/nu7hatch/.rvm/src/rbx-1.1.0-20100923/vm/external_libs/llvm/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -fomit-frame-pointer -fPIC -Ivm/external_libs/libtommath -Ivm/external_libs/libgdtoa -Ivm/external_libs/onig -Ivm/external_libs/libffi/include -Ivm/test/cxxtest -Ivm -I. -I/usr/local/include -Ivm/external_libs/udis86 -pipe -Wall -Wno-deprecated -DENABLE_LLVM -DHAS_EXECINFO -ggdb3 -O2 -Werror -DRBX_PROFILER -c -o vm/builtin/unpack.o vm/builtin/unpack.cpp 2>&1
cc1plus: warnings being treated as errors
vm/builtin/unpack.cpp: In function ‘rubinius::String* rubinius::unpack::uu_decode(rubinius::VM*, const char*&, const char*, size_t)’:
vm/builtin/unpack.cpp:256:36: error: value computed is not used
vm/builtin/unpack.cpp:258:19: error: value computed is not used
rake aborted!
Command failed with status (1): [gcc -Ivm/external_libs/llvm/include -