export JAVA_HOME="$(dirname $(dirname $(realpath $(which javac))))"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
// … | |
id("org.springframework.boot") version "2.1.5.RELEASE" | |
} | |
apply(plugin = "io.spring.dependency-management") | |
the<DependencyManagementExtension>().apply { | |
imports { | |
mavenBom("example:bom:1.0") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 <container-id>" | |
exit 1 | |
fi | |
function getContainerHealth { | |
docker inspect --format "{{json .State.Health.Status }}" $1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getURLParameter(name) { | |
var val = (RegExp('[?|&]' + name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]; | |
return val ? decodeURI(val) : val; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NOT FOR SHELL SCRIPT, but rather just for quick copy paste | |
# this is a copy-paste version with defaults of the full shell script docker-xenial.sh which is below this one in gist. | |
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && \ | |
mkdir -p /etc/apt/sources.list.d && \ | |
echo deb https://apt.dockerproject.org/repo ubuntu-xenial main > /etc/apt/sources.list.d/docker.list && \ | |
service lxcfs stop && apt-get remove -y -q lxc-common lxcfs lxd lxd-client && \ | |
apt-get update -q && apt-get upgrade -y -q && \ | |
apt-get install -y -q docker-engine && \ | |
mkdir -p /etc/systemd/system/docker.service.d && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
socat TCP-LISTEN:2375,reuseaddr,fork UNIX-CONNECT:/var/run/docker.sock & | |
export DOCKER_HOST=tcp://localhost:2375 | |
unset DOCKER_TLS_VERIFY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"path/filepath" | |
"os" | |
"runtime" | |
"github.com/mitchellh/go-homedir" | |
) | |
var configDirName = "example" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app/models/post.js | |
export default DS.Model.extend({ | |
body: DS.attr(), | |
comments: DS.hasMany(), | |
addComment(commentData) { | |
let store = Ember.getOwner(this).lookup('service:store'); | |
let comment = store.createRecord('comment', commentData); | |
this.get('comments').pushObject(comment); | |
return comment.save().then(() => { | |
return this.save(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION notify_trigger() RETURNS trigger AS $$ | |
DECLARE | |
channel_name varchar DEFAULT (TG_TABLE_NAME || '_changes'); | |
BEGIN | |
IF TG_OP = 'INSERT' THEN | |
PERFORM pg_notify(channel_name, '{"id": "' || NEW.id || '"}'); | |
RETURN NEW; | |
END IF; | |
IF TG_OP = 'DELETE' THEN | |
PERFORM pg_notify(channel_name, '{"id": "' || OLD.id || '"}'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 |
NewerOlder