Skip to content

Instantly share code, notes, and snippets.

View alexesDev's full-sized avatar

Alexey Yurchenko alexesDev

  • Digital Nomad
View GitHub Profile
class B1
{
};
class B2
{
};
class D1 : public B1, private B2
{
#include <iostream>
class Base1
{
int mA;
public:
Base1(int a) : mA(a) {}
void showBase1()
app.module('logics', function(module, app) {
var death;
death = function(model, object) {
if (model.get('health') <= 0) {
object.destroy();
}
};
app.physics.on('charactersContact:begin', function(e) {
if (!e.modelA.isAlly(e.modelB)) {
module Backend
module ModelHelper
def self.default_scope
scope = Proc.new if block_given?
self.default_scopes = [scope]
end
end
end
class Backend::Product < ::Product
@alexesDev
alexesDev / gist:5979432
Created July 11, 2013 21:29
Ogre minimal app with grid
#include <Ogre.h>
#include <OIS.h>
class FrameListener : public Ogre::FrameListener
{
OIS::Keyboard* mKeyboard;
OIS::Mouse* mMouse;
public:
FrameListener(OIS::Keyboard* keyboard, OIS::Mouse* mouse) :
def custom_form_for(object, *args, &block)
options = args.extract_options!
options.url = **как-то создаешь особенную ссылку на модель** if **находимся в админке**
simple_form_for(object, *(args << options.merge(builder: CustomFormBuilder)), &block)
end
#include "Ogre.h"
#include <SDL/SDL.h>
#include <SDL/SDL_syswm.h>
int main(int argc, char *argv[])
{
//=================================================
//-------------------------------------------------
//=================================================
@alexesDev
alexesDev / boost::factory.cpp
Last active December 28, 2015 20:49
C++ заметки
// Хватит писать фабрики, есть boost::factory, всё просто.
#include <boost/functional/factory.hpp>
#include <boost/function.hpp>
#include <boost/assign.hpp>
namespace Gui
{
class Element {};
class Button : public Element {};
class Position
int x: 0
int y: 0
class Size
int width: 0
int height: 0
class Geometry
Position position
<div class="article">
<h2 class="title">{{ field title }} First article {{ end }}</h2>
<div class="content">{{ field content, type: html }} Content {{ end }}</div>
</div>