Skip to content

Instantly share code, notes, and snippets.

View be9's full-sized avatar

Oleg Dashevskii be9

View GitHub Profile
project(sos2)
add_executable(circles circles.c Circle.c Object.c Point.c)
@be9
be9 / dnscopy.rb
Created September 30, 2012 05:14
#!/usr/bin/env ruby
#
# Copies domain information from Linode to rackspace
#
# Environment variables that should be set:
#
# LINODE_TOKEN
# RACKSPACE_USERNAME
# RACKSPACE_API_KEY
#
@be9
be9 / circle.c
Created September 26, 2012 07:00
#include <stdio.h>
#include "circle.h"
#include "new.h"
static void *Circle_ctor(void *_self, va_list *app) {
struct Circle *self = ((const struct Class *)Point)->ctor(_self, app);
self->rad = va_arg(*app, int);
return self;
}
@be9
be9 / service
Created February 7, 2012 06:37 — forked from brentkirby/service
Unicorn + Runit + RVM
#!/bin/bash -e
#
# Since unicorn creates a new pid on restart/reload, it needs a little extra love to
# manage with runit. Instead of managing unicorn directly, we simply trap signal calls
# to the service and redirect them to unicorn directly.
#
# To make this work properly with RVM, you should create a wrapper for the app's gemset unicorn.
#
function is_unicorn_alive {
class ProductImageUploader < CarrierWave::Uploader::Base
include CarrierWave::RMagick
# ...
version :micro do
process imagecore_square: 50
end
# ...
class SearchesController < ApplicationController
before_filter :authenticate
def show
@scope = params[:scope]
@query = params[:q]
unless @query.blank?
@product_searcher = build_product_searcher
member_searcher = build_member_searcher
/home/od/work/oss/sass/lib/sass/plugin/staleness_checker.rb:169:in `tree'
/home/od/work/oss/sass/lib/sass/plugin/staleness_checker.rb:159:in `compute_dependencies'
/home/od/work/oss/sass/lib/sass/plugin/staleness_checker.rb:142:in `dependencies'
/home/od/work/oss/sass/lib/sass/plugin/staleness_checker.rb:119:in `dependencies_stale?'
/home/od/work/oss/sass/lib/sass/plugin/staleness_checker.rb:154:in `block in dependency_updated?'
/home/od/work/oss/sass/lib/sass/plugin/staleness_checker.rb:119:in `each'
/home/od/work/oss/sass/lib/sass/plugin/staleness_checker.rb:119:in `any?'
/home/od/work/oss/sass/lib/sass/plugin/staleness_checker.rb:119:in `dependencies_stale?'
/home/od/work/oss/sass/lib/sass/plugin/staleness_checker.rb:154:in `block in dependency_updated?'
/home/od/work/oss/sass/lib/sass/plugin/staleness_checker.rb:75:in `call'
class Ability
include CanCan::Ability
def initialize(user)
@user = user
if user
can :complain, Post do |post|
post.user != user
end
~/ext/pulled/riak [master]% make
./rebar get-deps
==> cluster_info (get-deps)
==> skerl (get-deps)
==> protobuffs (get-deps)
==> basho_stats (get-deps)
==> riak_sysmon (get-deps)
==> mochiweb (get-deps)
==> webmachine (get-deps)
==> riak_core (get-deps)
if @message.save
if request.xhr?
render :nothing => true
else
flash[:notice] = 'Message sent!'
redirect_to messages_path
end
else
render :new, :layout => !request.xhr?