Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html data-darkreader-mode="dynamic" data-darkreader-scheme="dark">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Accidental Quality</title>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<style>
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,500;0,700;1,600&display=swap');
@alpap
alpap / example.go
Created June 7, 2020 10:51 — forked from yanmhlv/example.go
JSONB in gorm
package main
import (
"database/sql/driver"
"encoding/json"
"github.com/jinzhu/gorm"
_ "github.com/lib/pq"
)
@alpap
alpap / git-prompt.sh
Created May 21, 2020 09:58
mig-gw look like zsh main theme
# set window title
PS1='\[\033]0;Git-Bash: ${PWD//[^[:ascii:]]/?}\007\]'
PS1="$PS1"'\n' # new line
PS1="$PS1"'\[\033[32m\]' # change to green
PS1="$PS1"'➜ ' # ➜
PS1="$PS1"'\[\033[0m\]' # change color
PS1="$PS1"'\[\033[34m\]' # change to green
PS1="$PS1"' \w' # change color
PS1="$PS1"'\[\033[0m\]' # change color # for detection by MSYS2 SDK's bash.basrc
@alpap
alpap / pipeline.gdsl
Created January 16, 2020 13:43 — forked from ggarcia24/pipeline.gdsl
GDSL supporting pipeline declarative
//The global script scope
def ctx = context(scope: scriptScope())
//What things can be on the script scope
contributor(ctx) {
method(name: 'pipeline', type: 'Object', params: [body: Closure])
property(name: 'params', type: 'org.jenkinsci.plugins.workflow.cps.ParamsVariable')
property(name: 'env', type: 'org.jenkinsci.plugins.workflow.cps.EnvActionImpl.Binder')
property(name: 'currentBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder')
property(name: 'scm', type: 'org.jenkinsci.plugins.workflow.multibranch.SCMVar')
@alpap
alpap / gg.css
Created January 8, 2020 09:01
Open vivaldi://experiments -> Enable "Allow for using CSS modifications" -> Open Appearance section in settings -> Choose the folder you want to use -> Place your CSS files inside it -> Restart Vivaldi to see them in effect
/* Auto hide bookmark bar */
#browser:not(.color-behind-tabs-off) .toolbar-addressbar {
background: inherit;
}
#browser.tabs-top.address-top.bookmark-bar-top .toolbar-addressbar,
#browser.tabs-top.address-bottom.bookmark-bar-bottom .toolbar-addressbar,
#browser.tabs-top.address-bottom.bookmark-bar-top .toolbar-addressbar,
#browser.tabs-bottom.address-top.bookmark-bar-top .toolbar-addressbar,
@alpap
alpap / alp.css
Created January 4, 2020 15:49
css classes for easier everyday styles
.shadow {
box-shadow: 0px 0px 4px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.shadow-md {
box-shadow: 0px 0px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.shadow-lg {
box-shadow: 0px 0px 16px 0 rgba(0, 0, 0, 0.2),
@alpap
alpap / postgres.sh
Last active July 25, 2019 13:22 — forked from mrw34/postgres.sh
Enabling SSL for PostgreSQL in Docker
#!/bin/bash
set -euo pipefail
openssl req -new -text -passout pass:abcd -subj /CN=localhost -out server.req
openssl rsa -in privkey.pem -passin pass:abcd -out server.key
openssl req -x509 -in server.req -text -key server.key -out server.crt
chmod 600 server.key
chown 70 server.key
docker run -d --name postgres -v $PWD/server.crt:/var/lib/postgresql/server.crt:ro -v $PWD/server.key:/var/lib/postgresql/server.key:ro postgres:11-alpine -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
@alpap
alpap / cleanWin.bat
Created June 7, 2019 12:54
Clean your windows installation
@rem *** Disable Some Service ***
sc stop DiagTrack
sc stop diagnosticshub.standardcollector.service
sc stop dmwappushservice
sc stop WMPNetworkSvc
sc stop WSearch
sc config DiagTrack start= disabled
sc config diagnosticshub.standardcollector.service start= disabled
sc config dmwappushservice start= disabled
@alpap
alpap / preactTest.js
Created April 17, 2019 11:29
preact test
export default class TodoList extends Component {
state = { todos: [], text: '', count: 0 };
setText = e => {
this.setState({ text: e.target.value });
};
addTodo = () => {
let { todos, text, count } = this.state;
todos = todos.concat({ text: text, id: count++ });
this.setState({ todos, text: '', count: count++ });
};
@alpap
alpap / Untitled-1
Created October 31, 2018 14:28
servicemd
cat <<'EOF' > /etc/systemd/system/beepkg.service
[Unit]
Description=beepkg
AssertPathExists=/usr/local/beepkg
[Service]
WorkingDirectory=/usr/local/beepkg
ExecStart=/usr/local/beepkg/beepkg