Skip to content

Instantly share code, notes, and snippets.

View mxgrn's full-sized avatar

Max Gorin mxgrn

View GitHub Profile
@mxgrn
mxgrn / netzke10roadmap.md
Last active January 4, 2016 10:13
Netzke 1.0 rough roadmap

A very rough todo list for the Netzke 1.0 release (WIP)

NOTE: this is not replacement for CHANGELOG (CHANGELOG for Basepack).

Netzke Core

  • Currently there's an experimental implementation of the (badly named) clone option in netzkeLoadComponent JS method, which allows loading multiple instances of the same child component, providing different configuration options for each instance. I'd like to consolidate this with the "normal" loading method, and thus get this functionality available by default.
  • Concatenating JS mixins should be made less error-prone (dangling commas, etc)
  • Routing. In the app I'm currently developing there's a need for routing, and I think I came up with a simple and flexible way to use Ext JS's Controller to do just that (I'm able to use nested routes like "#clients/2/orders/1/items").
  • Currently all the component DSL

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh [email protected]

Add ssh fingerprint and enter password provided in email

var gulp = require('gulp'),
gutil = require('gulp-util'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
imagemin = require('gulp-imagemin'),
rename = require('gulp-rename'),
clean = require('gulp-clean'),
@mxgrn
mxgrn / gist:6342626
Created August 26, 2013 15:21
vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 26 2013 17:03:00)
MacOS X (unix) version
Compiled by Homebrew
Huge version without GUI. Features included (+) or not (-):
+arabic +file_in_path +mouse_sgr +tag_binary
+autocmd +find_in_path -mouse_sysmouse +tag_old_static
-balloon_eval +float +mouse_urxvt -tag_any_white
-browse +folding +mouse_xterm -tcl
++builtin_terms -footer +multi_byte +terminfo
+byte_offset +fork() +multi_lang +termresponse
class BookFormWithFileUpload < Netzke::Basepack::Form
def configure(c)
super
c.model = "Book"
end
def items
[{name: 'cover', xtype: :filefield}, *super]
end
@mxgrn
mxgrn / gist:5402155
Last active October 19, 2018 02:19 — forked from billygoat/gist:5320505
Adds a new entry in nvALT, with title set to page title, tags set to "bookmarks", and body containing page title, link, and text selected on page (if present).
/* Source code */
javascript:(function(){
var w=window,d=document,pageSelectedTxt=w.getSelection?w.getSelection():(d.getSelection)?d.getSelection():(d.selection?d.selection.createRange().text:0),pageTitle=d.title,pageUri=w.location.href,tmplt="";
tmplt="Title: "+pageTitle+"\nLink: "+pageUri+"\n";
if (pageSelectedTxt != "") {
pageSelectedTxt="\n---\n"+pageSelectedTxt;
}
w.location.href="nvalt://make/?txt="+encodeURIComponent(tmplt+pageSelectedTxt)+"&title="+encodeURIComponent(pageTitle)+"&tags=bookmarks";
})();
@mxgrn
mxgrn / gist:663933
Created November 5, 2010 10:24
Git's pre-commit hook to remove trailing whitespaces/tabs
#!/bin/sh
#
# This will abort "git commit" and remove the trailing whitespaces from the files to be committed.
# Simply repeating the last "git commit" command will do the commit then.
#
# Put this into .git/hooks/pre-commit, and chmod +x it.
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
@mxgrn
mxgrn / gist:638919
Created October 21, 2010 17:30
Wrong scope of yield?
# (Ruby version: 1.9.2)
#
##### A million-dollar question: why the following isn't working?
#
#
class A
def self.metamethod(name)
define_method(name) do
yield
// in grid_panel_pre.js:
// React on before edit event to set the recordId property in the editor
this.on('beforeedit', function(e){
e.grid.getColumnModel().getCellEditor(e.column, e.record).field.recordId = e.record.id;
});
module Netzke
class FileUploader < FormPanel
INITIAL_UPLOAD_FIELDS_NUMBER = 5
# Extra javascripts
def self.include_js
[
"#{File.dirname(__FILE__)}/file_uploader_extras/file_uploader.js"
]
end