Skip to content

Instantly share code, notes, and snippets.

View nobiit's full-sized avatar
:shipit:
^^

Nguyễn Đức Chiến nobiit

:shipit:
^^
View GitHub Profile
@nobiit
nobiit / laravel-mix deep css
Last active September 5, 2019 21:39
[laravel-mix] Fix /deep/ in css of vue
https://github.com/JeffreyWay/laravel-mix/issues/1850#issuecomment-528527499
Hi everyone, here is the solution:
```js
mix.options({
postCss: [
postcss.plugin('deepCssVueScoped', () => {
let sign = '[deep]';
return function (root, result) {
<template>
<el-container class="app-container">
<app-sidebar/>
<el-container direction="vertical">
<app-header :menu="menu"/>
<el-main>
<transition
name="bounce"
enter-active-class="bounceInLeft"
leave-active-class="bounceOutRight"
@nobiit
nobiit / App.vue
Created September 16, 2019 16:18
Version 2
<template>
<el-container class="app-container">
<app-sidebar/>
<el-container direction="vertical">
<app-header :menu="menu"/>
<el-main>
<transition
name="bounce"
enter-active-class="bounceInLeft"
leave-active-class="bounceOutRight"
FROM ubuntu:latest
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y build-essential python3 python3-pip libcap-dev libpq-dev libcups2-dev zip sudo cgroup-tools vim git iputils-ping net-tools wget curl iproute2 && \
wget https://github.com/zyedidia/micro/releases/download/v1.4.1/micro-1.4.1-linux64.tar.gz -O /tmp/micro.tar.gz && \
tar -zxvf /tmp/micro.tar.gz micro-1.4.1/micro -O > /usr/local/bin/micro && \
chmod +x /usr/local/bin/micro
ADD . /opt/app/
WORKDIR /opt/app
RUN useradd -m cmsuser && \
FROM alpine:3.3
COPY root/. /
RUN echo "@community http://dl-4.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
echo "@testing http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
echo "@edge http://dl-4.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories && \
# read packages and update
apk update && apk upgrade && \
// A list of regular expressions that match arbitrary IPv4 addresses,
// for which a number of weird notations exist.
// Note that an address like 0010.0xa5.1.1 is considered legal.
const ipv4Part = '(0?\\d+|0x[a-f0-9]+)';
const ipv4Regexes = {
fourOctet: new RegExp(`^${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}$`, 'i'),
longValue: new RegExp(`^${ipv4Part}$`, 'i')
};
const zoneIndex = '%[0-9a-z]{1,}';
#!/usr/bin/env bash
emulator \
-avd Android \
-selinux permissive \
-writable-system \
-delay-adb \
-show-kernel \
-shell \
# -verbose \
@nobiit
nobiit / logo
Created September 12, 2021 12:09
#!/usr/bin/env bash
# set -ex
IP_SOURCE=${IP_SOURCE:-192.168.123.10}
for ip_address in 1.1.1.1 8.8.8.8 192.168.123.1 192.168.1.123 192.168.1.234 192.168.1.35 10.1.0.1 10.1.0.2 10.10.0.1 google.com one.one.one.one nobi.dev portainer.nobi.dev; do
result=$(ping -S ${IP_SOURCE} -c 1 -t 1 ${ip_address} >/dev/null && echo "OK" || echo "FAILED")
printf "%25s -> %s\n" ${ip_address} ${result}
done
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.