Skip to content

Instantly share code, notes, and snippets.

@xsephiroth
xsephiroth / default.conf
Created August 31, 2017 13:07
NGiNX Configuration for Vue-Router in HTML5 Mode
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;
@xsephiroth
xsephiroth / main.js
Created September 24, 2017 06:51
electron x-frame-options
const {session} = require('electron')
const {ipcMain} = require('electron')
ipcMain.on('disable-x-frame', (event, arg) => {
session.fromPartition(arg.partition).webRequest.onHeadersReceived({}, (d, c) => {
if(d.responseHeaders['x-frame-options'] || d.responseHeaders['X-Frame-Options']){
delete d.responseHeaders['x-frame-options'];
delete d.responseHeaders['X-Frame-Options'];
@xsephiroth
xsephiroth / GitConfigHttpProxy.md
Created October 26, 2017 13:53 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy

Configure Git to use a proxy

##In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@xsephiroth
xsephiroth / CryptoJs & Golang
Last active July 13, 2023 03:33
AES decrypt encrypt with CryptoJs & Golang
<template>
<div>
</div>
</template>
<script>
import CryptoJs from "crypto-js"
export default {
name: "",
data(){
package main
import (
"io"
"log"
"os"
"os/exec"
"io/ioutil"
"bytes"
)
@xsephiroth
xsephiroth / 50-usb-mount.rules
Created June 19, 2018 14:14
udev mount usb by pid uid
# /etc/udev/rules.d/50-usb-mount.rules
ACTION=="add",ATTRS{idVendor}=="0951",ATTRS{idProduct}=="1643",RUN+="/bin/mkdir -p /media/abc",RUN+="/bin/mount -o relatime,sync,utf8,uid=1000,gid=1000,umask=002 /dev/%k /media/abc"
ACTION=="remove",ATTRS{idVendor}=="0951",ATTRS{idProduct}=="1643",RUN+="/bin/umount -l /media/acc",RUN+="/bin/rmdir /media/abc"
@xsephiroth
xsephiroth / index.html
Created December 7, 2018 06:40
html5 fullscreen
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
@xsephiroth
xsephiroth / traefik.swarmMode.notoml.yml
Last active July 12, 2021 11:11
traefik docker swarm example
# without traefik.toml config file
# use docker service command
version: "3.7"
services:
reverse-proxy:
image: traefik:1.7
networks:
- traefiknet
@xsephiroth
xsephiroth / consumer.sh
Created November 21, 2019 13:27
gstreamer rtp vp8
gst-launch-1.0 udpsrc port=9001 ! application/x-rtp, clock-rate=90000, media=video, encoding-name=VP8 ! rtpvp8depay ! vp8dec ! autovideosink
@xsephiroth
xsephiroth / hooks.js
Last active February 19, 2020 07:31
React CRA service worker update demo
// setup check service worker manually update interval
const useUpdatePwaServiceWorker = (interval=60 * 1000) => {
useEffect(() => {
const update = () => {
const sw = window.navigator.serviceWorker;
sw && sw.getRegistrations()
.then(rs => rs.forEach(r => r.update()))
.catch(console.error);
};