Skip to content

Instantly share code, notes, and snippets.

@egoarka
egoarka / eba.sh
Created November 30, 2018 13:38
JS alike destructuring assignment for bash
echo "33:34" | awk -F':' '{ print $1, $2 }' | read a b <<< (cat)
read c d <<< $(echo "21:22" | awk -F':' '{ print $1, $2 }')
@dweinstein
dweinstein / Dockerfile-nodejs
Last active June 29, 2022 16:59
Install node modules before copying over your working code so that node_modules are built (and cached) before you change your service code!
# ...
ADD package.json /tmp/package.json
RUN cd /tmp && npm install && \
mkdir -p /opt/app && cp -a /tmp/node_modules /opt/app/
# ...
WORKDIR /opt/app
ADD . /opt/app
@rizo
rizo / Dockerfile
Last active January 19, 2023 20:14
Alpine (3.6) based docker image with Protocol Buffers compiler supporting Go.
# Protobuf Builder
# ================
#
# This image builds protocol buffers library from source with Go generation
# support. The builder and runner images are produced.
# Builder Image
# -------------
FROM golang:1.8.3-alpine3.6 as builder
@bartosjiri
bartosjiri / manjaro-broadcom-wlan-fix.md
Last active February 18, 2023 10:33
Manjaro broadcom WLAN fix

Manjaro broadcom WLAN fix

Problem

Manjaro installation doesn't offer any WLAN connections.

Solution

  1. Connect the device to the internet through ethernet, phone-to-USB or other available method.

  2. Uninstall current drivers:

@akkida746
akkida746 / WsFilter.java
Created October 18, 2016 11:23
Configure Spring autowire in java Filter
public class WsFilter implements Filter {
private ApplicationContextProvider springContext;
private FilterConfig filterConfig;
private MessageFactory msgFactory = null;
private static final Logger logger_ = Logger.getLogger(WsFilter.class.getName());
private static final Logger soap_logger = Logger.getLogger("soapLogger");
@Autowired
private WsFilterHelper helper;
@jjromannet
jjromannet / gist:9a5ee7e480801576b68af1ed5fd8e979
Created November 10, 2021 07:44
Dockercompose config tu run MySQL 5.7 that works
version: "3.9"
services:
db:
image: mysql/mysql-server:5.7
environment:
MYSQL_DATABASE: 'db'
MYSQL_ROOT_PASSWORD: 'secret-pw'
MYSQL_ROOT_HOST: '%'
ports:
- '3306:3306'
@MaxXSoft
MaxXSoft / Dockerfile
Created November 27, 2022 09:40
A fun tool for generating an x86-64 Linux program that runs in reverse order.
FROM ubuntu:20.04
RUN apt update && DEBIAN_FRONTEND="noninteractive" apt install -y \
python3 build-essential
WORKDIR /root
@gexiangdong
gexiangdong / README.md
Last active September 21, 2023 02:11
在非spring项目中使用slf4j和logback

在 spring-boot 项目中, slf4j和logback被自动引入,只需要配置logback即可使用,当不是spring-boot项目时,需要我们手工做点事才能使用。

增加依赖

    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.2.3</version>
 
@straker
straker / two-way-binding.js
Last active December 23, 2023 04:30
Simple and small two-way data binding between DOM and data
/**
* @param {object} scope - Object that all bound data will be attached to.
*/
function twoWayBind(scope) {
// a list of all bindings used in the DOM
// @example
// { 'person.name': [<input type="text" data-bind="person.name"/>] }
var bindings = {};
// each bindings old value to be compared for changes
apiVersion: v1
kind: ConfigMap
metadata:
name: redis-config
data:
redis.conf: |
# Redis configuration file example.
#
# Note that in order to read the configuration file, Redis must be
# started with the file path as first argument: