Skip to content

Instantly share code, notes, and snippets.

View SlyDen's full-sized avatar

Denys Slipetskyy SlyDen

View GitHub Profile
(define-key dired-mode-map (kbd "<M-return>") 'shell-instead-dired)
(define-key dired-mode-map (kbd «K») 'dired-do-kill-lines)
(define-key dired-mode-map (kbd «k») 'dired-previous-line)
(define-key dired-mode-map (kbd «J») 'dired-goto-file)
(define-key dired-mode-map (kbd «j») 'dired-next-line)
(define-key dired-mode-map (kbd «M-p») 'ace-window)
(define-key dired-mode-map (kbd «M-q») 'ace-window)
(define-key dired-mode-map (kbd "/") 'helm-occur)
;; в любом режиме Alt+hjkl ведут себя как обычный vim
@SlyDen
SlyDen / Dockerfile
Created February 7, 2017 11:59
yarn pkg example
FROM node:latest
MAINTAINER Kamil Karczmarczyk <[email protected]>
# Global install yarn package manager
RUN npm set progress=false && \
npm install -g --progress=false yarn
WORKDIR /workspace
@SlyDen
SlyDen / build.gradle
Created February 6, 2017 07:49
Reload classes for gradle -t
if (gradle.startParameter.continuous) {
run {
flattenClassloaders = true
}
}
FROM gliderlabs/alpine:3.3
ENTRYPOINT ["/bin/registrator"]
COPY . /go/src/github.com/gliderlabs/registrator
RUN apk-install -t build-deps build-base go git mercurial \
&& cd /go/src/github.com/gliderlabs/registrator \
&& export GOPATH=/go \
&& go get \
&& go build -ldflags "-X main.Version=$(cat VERSION)" -o /bin/registrator \
&& rm -rf /go \
FROM ubuntu:14.04
RUN apt-get update -y && \
apt-get install -y curl postgresql postgresql-client && \
rm -rf /var/lib/apt/lists/*
CMD bash
tyrell:~▻ cat Library/Local/bin/ber1docker
#!/bin/bash
DOCKER_REMOTE_HOST="ber1.local"
DOCKER_SOCK="$TMPDIR/docker.sock"
export DOCKER_HOST="unix://$DOCKER_SOCK"
rm $DOCKER_SOCK
socat UNIX-LISTEN:$DOCKER_SOCK,reuseaddr,fork \
EXEC:"ssh root@$DOCKER_REMOTE_HOST 'socat STDIO UNIX-CONNECT:/var/run/docker.sock'" &
model() {
let userPromise = this.store.findAll(‘user’);
userPromise.catch((error) => {
// transition to another route and show some error notification saying your team is doing their best to fix the problem
});
return userPromise;
}
@SlyDen
SlyDen / nexus-service-in-swarm.sh
Created October 26, 2016 06:34
Nexus container in swarm
docker volume create nexus-data
docker service create -p 8081:8081 --name nexus --mount type=volume,src=nexus-data,dst=/nexus-data sonatype/docker-nexus3
docker service update --env-add JAVA_MAX_MEM=768m nexus
@EqualsAndHashCode
class Person {
String name
String surname
int age
}
def test() {
given:
def person = new Person(name: 'name', surname: 'surname', age: 32)
@SlyDen
SlyDen / Example.java
Created April 8, 2016 08:01 — forked from ldaley/Example.java
Periodic background jobs in Ratpack
import ratpack.exec.ExecController;
import ratpack.exec.Execution;
import ratpack.http.client.HttpClient;
import ratpack.server.RatpackServer;
import ratpack.service.Service;
import ratpack.service.StartEvent;
import ratpack.service.StopEvent;
import java.net.URI;
import java.util.Optional;