Skip to content

Instantly share code, notes, and snippets.

View Alex-Shilman's full-sized avatar

Alex Shilman Alex-Shilman

View GitHub Profile
@Alex-Shilman
Alex-Shilman / README.md
Created September 28, 2015 12:08 — forked from BinaryMuse/README.md
Integrating React with Marionette

Integrating React with Marionette

See ReactComponentView and BackboneModelWatchMixin, below.

Notes

The BackboneModelWatchView could use some additional methods to allow adding/removing watched models after the component is created.

@Alex-Shilman
Alex-Shilman / 1.html
Created October 5, 2015 20:11 — forked from jardix22/1.html
Modal Bootstrap 3 + Marionette.js
<script id="modal-view-template" type="text/html">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
...
</div>
@Alex-Shilman
Alex-Shilman / gist:16c7866e55fa305674b8
Created December 3, 2015 18:38 — forked from belackriv/gist:008087f6f005aee1167f
Marrionette Table without composite view
//
//Regions
//
var NoWrapRegion = Backbone.Marionette.Region.extend({
attachHtml: function (view) {
this.el.innerHTML="";
var children = view.el.childNodes;
while (children.length > 0) {
this.el.appendChild(children[0]);
'use strict';
import Backbone from 'backbone';
import Radio from 'backbone.radio';
import Marionette from 'marionette';
import MyselfModel from 'lib/common/models/myselfModel';
import UserAccountCollection from 'lib/common/models/userAccountCollection';
import AccountCollection from 'lib/common/models/accountCollection';
var Col = require('react-bootstrap/lib/Col')
var PageHeader = require('react-bootstrap/lib/PageHeader')
var React = require('react')
var Row = require('react-bootstrap/lib/Row')
var {connect} = require('react-redux')
var {reduxForm} = require('redux-form')
var DateInput = require('./DateInput')
var FormField = require('./FormField')
var LoadingButton = require('./LoadingButton')
@Alex-Shilman
Alex-Shilman / chain-mysql.sh
Created September 19, 2016 18:20 — forked from jmolivas/chain-mysql.sh
How to download and install Drupal 8 using Drupal Console
drupal chain --file=~/.console/chain/quick-start-mysql.yml
@Alex-Shilman
Alex-Shilman / comment.js
Created April 2, 2018 16:02
Using Mongoose multiple collections
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var ObjectId = Schema.ObjectId;
var commentSchema = new Schema({
comment: type:String,
user_id:{
type:Schema.Types.ObjectId, ref:'User'
},
is_active :1
@Alex-Shilman
Alex-Shilman / docker-help.md
Last active November 18, 2018 20:30 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

Theming Ant Design with Sass and Webpack

This is a solution on how to theme/customize Ant Design (which is written in Less) with Sass and webpack. Ant itself offers two solutions and a related article on theming, but these are only applicable if you use Less, the antd-init boilerplate or dva-cli.

What this solution offers:

  • use a single sass-file to customize (no duplicate variables for your project and Ant)
  • hot reload compatibility
  • no dependencies on outdated npm modules
  • easy integration with your existing webpack setup (webpack 3+ tested)
@Alex-Shilman
Alex-Shilman / App.js
Created May 12, 2020 14:08 — forked from jaredpalmer/App.js
Next.js-like SSR without Next.js.
import React from 'react';
import Route from 'react-router-dom/Route';
import Link from 'react-router-dom/Link';
import Switch from 'react-router-dom/Switch';
const App = ({ routes, initialData }) => {
return routes
? <div>
<Switch>
{routes.map((route, index) => {