Skip to content

Instantly share code, notes, and snippets.

@dra1n
dra1n / react-test.js
Created March 12, 2019 08:03
React code review
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
class Parent extends PureComponent {
handleUserClick(user) {
alert(`Hello I am ${user.name}`)
}
render() { return null }
@dra1n
dra1n / ns-cheatsheet.clj
Created January 19, 2019 16:37 — forked from ghoseb/ns-cheatsheet.clj
Clojure ns syntax cheat-sheet
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.
const merge = require('webpack-merge')
const common = require('./webpack.common.js')
const version = require('./version.json').version
const path = require('path')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const CleanWebpackPlugin = require('clean-webpack-plugin')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const ManifestPlugin = require('webpack-manifest-plugin')
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
class Parent extends PureComponent {
handleUserClick(user) {
alert(`Hello I am ${user.name}`)
}
render() { return null }
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@dra1n
dra1n / Vim plugins
Created July 7, 2017 08:06
Vim plugins list
CoVim
DrawIt
VimClojure
alchemist.vim
conque
elm-vim
gocode
loremipsum
mirror.vim
neoformat
severity: error
linters:
BorderZero:
enabled: true
convention: zero
BemDepth:
enabled: true
@dra1n
dra1n / DOCKER_X11_OSX.md
Created May 20, 2017 08:14
Run GUI apps in containier in OSX (docker for mac)

Run XQuartz

  • Update preferences 'Security' tab - turn on 'Allow connection from network clients'
  • Restart XQuartz and then check to see that it is listening on port 6000:
lsof -i :6000

Install socat

And run it so it will wait for connections and then pass them over to XQuartz.

# improve colors
set -g default-terminal 'screen-256color'
# act like vim
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h select-window -t :-
set mouse=a
" set ttym=xterm2
set clipboard=unnamed
syntax on
colorscheme railscasts
" Copy / paste stuff
nmap <F1> :set paste<CR>:r !pbpaste<CR>:set nopaste<CR>
imap <F1> <Esc>:set paste<CR>:r !pbpaste<CR>:set nopaste<CR>
nmap <F2> :.w !pbcopy<CR><CR>