Skip to content

Instantly share code, notes, and snippets.

View Paxa's full-sized avatar

Pavel Evstigneev Paxa

View GitHub Profile
Pavel:vertexdb pavel$ cmake .
-- Found TokyoCabinet: /usr/local/lib/libtokyocabinet.dylib
-- Found Yajl: /usr/local/lib/libyajl.dylib
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/pavel/Sites/vertexdb
Pavel:vertexdb pavel$ make
[100%] Building C object CMakeFiles/vartextdb.dir/source/main.c.o
In file included from /Users/pavel/Sites/vertexdb/source/VertexServer.h:5,
new Haml('userbar', function (params, render, use) {
with (params) {
this.use({
user: user.merge({full_name: user.first_name + ' ' + user.last_name}),
session: session
});
}
lib 'mootools' do
repo 'http://github.com/mootools/mootools-core.git'
tag '1.2.4'
end
lib 'mootools-more' do
repo 'http://github.com/mootools/mootools-more.git'
tag '1.2.4'
end
$('some-link').clk(function(el, event) {
Footer.render('my-friends', Profile.id);
});
var Present = {
id: function(present_id, callback){
if (var present = this.getCached(present_id)) {
callback(present);
} else {
this.fetch(present_id, callback);
@Paxa
Paxa / gist:743270
Created December 16, 2010 10:37 — forked from rwz/gist:743264
var wiget = new Class({
Includes: [Class.MethodMutators],
something: function () {
return new Element('div');
}.mutator('setter'),
onComplete: function () {
this.hide();
}.mutator('bind'),
class Report
class << self
attr_accessor :current
def store(string)
@current ||= new
@current.store(string)
end
module Minion
module Daemon
extend self
attr_accessor :pid, :log
def fork_or_skip
arg = ARGV.join(" ")[/\-d\s\d+/] || ARGV.join(" ")[/\-d/]
return unless arg
// this stuff breaks vkontakte js api
Array.prototype.asdf = function() {
return 'array';
};
VK.init(function() {
VK.api('video.search', {q: 'dfdfd', count: 20}, function(res) {
@Paxa
Paxa / 0_example.haml
Created August 25, 2011 07:20
microdata attributes support for rails helpers and haml (requires gem mida)
class Post < ActiveRecord::Base
html_schema_type "http://schema.org/BlogPosting"
end
%article[post, :blogPosts]
= link_to post, :itemprop => "url" do
%h3[:name]>= post.title
.post_body[:articleBody]= post.body.html_safe
% bundle exec mida http://lawrencewoodman.github.com/mida/news/
Parsing: http://lawrencewoodman.github.com/mida/news/
---
:type: http://schema.org/Blog
% bundle exec mida -v http://lawrencewoodman.github.com/mida/news/
Parsing: http://lawrencewoodman.github.com/mida/news/