Skip to content

Instantly share code, notes, and snippets.

View mxgrn's full-sized avatar

Max Gorin mxgrn

View GitHub Profile
class BookFormWithFileUpload < Netzke::Basepack::Form
def configure(c)
super
c.model = "Book"
end
def items
[{name: 'cover', xtype: :filefield}, *super]
end
@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
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'),

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

@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
### Keybase proof
I hereby claim:
* I am mxgrn on github.
* I am mxgrn (https://keybase.io/mxgrn) on keybase.
* I have a public key ASAawdHU72TBx7thfEqkiCLt2j4IXULM4npcWfbwHkpGaQo
To claim this, I am signing this object:
@mxgrn
mxgrn / dvorak-to-colemak.md
Last active January 9, 2019 19:02
Dvorak -> Colemak

I switched to Dvorak about 9 years ago. It was my 3rd touch-typed layout, after ЙЦУКЕН and QWERTY, both of which I was using daily. Now, that I look back, I think choosing Dvorak wasn't ideal: while it's been a huge relief after QWERTY (this ubiquitous finger twister), Dvorak showed certain drawbacks I should have noticed from the very beginning. A good example would be the frequent "sl" combination (slow, sleep, slide, etc), which is a same-finger combination for the right pinkie. Recently, some extra research showed it must have always been Colemak.

Learning a new layout is akin to learning a musical instrument: the cognitive effort required for deliberate practice feels pleasingly mind stretching. So, I decided to switch again. Below this paragraph I'll be posting everything I have typed so far during my Colemak practice, including some report on the progress - for what it's worth. Minor editing here and there is possible for readability. Let's see how much typing it takes to get back to a reasonable spee

Verifying that "maxgorin.id" is my Blockstack ID. https://onename.com/maxgorin
# install wkhtmltopdf
RUN apt-get -q update && \
apt-get -qy install --no-install-recommends wget && \
wget --no-check-certificate -nv -O /tmp/wkhtmltox.deb https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.bullseye_amd64.deb && \
apt-get -qy install /tmp/wkhtmltox.deb && \
cd /usr/local/bin && \
cp wkhtmltoimage /usr/bin/wkhtmltoimage && \
cp wkhtmltopdf /usr/bin/wkhtmltopdf
@mxgrn
mxgrn / book.ex
Created November 4, 2023 16:24
Book Ash Resource
defmodule AshTable.Book do
use Ash.Resource, data_layer: AshPostgres.DataLayer
postgres do
table "books"
repo AshTable.Repo
end
attributes do
uuid_primary_key :id