Skip to content

Instantly share code, notes, and snippets.

View abogoyavlensky's full-sized avatar
🌊
Coding

Andrey Bogoyavlenskiy abogoyavlensky

🌊
Coding
View GitHub Profile
@asrivascrealytee
asrivascrealytee / grafana.nomad.hcl
Created March 11, 2019 16:17
Grafana+loki+promtail nomad example
job "grafana" {
datacenters = ["dc1"]
type = "service"
group "grafana" {
count = 1
restart {
attempts = 10
interval = "5m"
@zelark
zelark / pg_test.types.clj
Last active February 2, 2024 19:47
Support json and jsonb Postgres types in Clojure.
;; For supporting more PG types, see https://github.com/remodoy/clj-postgresql
(ns pg-test.types
(:require [cheshire.core :as json]
[clojure.java.jdbc :as jdbc])
(:import [org.postgresql.util PGobject]
[java.sql PreparedStatement]))
;; Writing
(defn- to-pg-json [data json-type]
@MetalArend
MetalArend / swarm.yml
Last active June 16, 2024 10:11
Run a GitLab Runner on your Swarm
version: '3.4'
secrets:
# Find your registration token at: "Your project" > "Settings" > "CI/CD" > "Runners settings" > "Specific Runners" (look for registration token)
# Register it as `GITLAB_REGISTRATION_TOKEN`: `docker secret create GITLAB_REGISTRATION_TOKEN YOUR_REGISTRATION_TOKEN`
GITLAB_REGISTRATION_TOKEN:
external: true
# Find your personal access token at: "Your user account" > "Settings" > "Access Tokens" > "Create personal access token" (for api)
# Register it as `GITLAB_PERSONAL_ACCESS_TOKEN`: `docker secret create GITLAB_PERSONAL_ACCESS_TOKEN <YOUR ACCESS TOKEN>`
@pbostrom
pbostrom / cljs-npm.md
Last active March 8, 2024 07:53
Loading third-party npm modules in ClojureScript

Loading third-party npm modules in ClojureScript

This example shows how to load the re-resizable npm module which provides a resizable React component. Requires the lein-npm plugin.

  1. Add the npm module to the :npm :dependencies section of project.clj:
 :npm {:package {:scripts {:build "webpack -p"}}
       :dependencies [[react "16.4.0"]
                      [react-dom "16.4.0"]
                      ["@cljs-oss/module-deps" "1.1.1"]
@ruanbekker
ruanbekker / my-docker-cheatsheet.md
Last active April 14, 2021 04:34
My Docker Cheatsheet

:WIP:

Docker

Docker Volumes

  • nocopy

The nocopy modifier is for when you are creating a volume and data already exists in the container's path, you can specify if you want that data copied when the volume is created.

@igogrek
igogrek / Cookbook.md
Last active May 29, 2024 02:00
Cookbook

This cookbook is similar to Vue cookbook but contains our custom recipes for some specific cases.

Form validation

For form validation we use Vuelidate

export default Vue.extend({
  ...
 validations: {
@igogrek
igogrek / Vue code style.md
Last active May 29, 2024 01:58
Code style and application structure

Application structure

General

  1. Application has tree structure with folders for each "feature"
  2. Feature folders are named with lowerCamelCase → myComponentDashboard
  3. Feature can contain any number of components and nested features
  4. Components are named using UpperCamelCase → MyWidgetComponent.vue
  5. Component can have translation .yml file named correspondingly → MyWidgetComponent.yml
  6. If component requires more than 2 files: .vue and .yml file - folder is created with the same name → MyWidgetComponent
@Jannis
Jannis / build.clj
Last active May 6, 2020 10:47
Using GraphQL / Apollo Client / React Apollo in the next ClojureScript release
;; Run using a local build of ClojureScript master, e.g.:
;; clj -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.155"}}}' -i build.clj
(require '[cljs.build.api :as b])
(b/watch "src"
{:output-dir "out"
:output-to "out/main.js"
:optimizations :none
:verbose true
@emmettna
emmettna / Docker-compose Nginx + Django + Gunicorn
Last active June 27, 2021 20:50
Docker-compose Nginx + Django + Gunicorn
1. Make folder tree like these
mi_project
├── src
│ ├── midjangoapp
│ ├── manage.py
├── config
│ ├── requirements.pip
│ ├── nginx
│ ├── midjangoapp.conf
├── Dockerfile
@thinhdanggroup
thinhdanggroup / fix_xz_no_file.md
Created January 19, 2018 09:57
fix "tar (child): xz: Cannot exec: No such file or directory"

Install

sudo apt-get install xz-utils

Decompress again

tar xvf