Skip to content

Instantly share code, notes, and snippets.

View basic test traefik
services:
reverse-proxy:
# The official v2 Traefik docker image
image: traefik:v2.5
# Enables the web UI and tells Traefik to listen to docker
command: --api.insecure=true --providers.docker
ports:
# The HTTP port
- "80:80"
# The Web UI (enabled by --api.insecure=true)
@pierangelo1982
pierangelo1982 / vue-cli-django.md
Created Mar 6, 2021 — forked from lsapan/vue-cli-django.md
Using Vue CLI to start a Vue frontend for use with a Django backend
View vue-cli-django.md

Using Vue CLI to start a Vue frontend for use with a Django backend

Note: This guide has been updated for use with @vue/cli version 4! Please make sure you're using the latest version of @vue/cli.

When it comes to starting new Vue projects, you can't really beat Vue CLI. The Vue team has done a phenomenal job of making an easy-to-use tool for getting started with reasonable defaults. If you're using Django though, you may not have the easiest time getting its static system and webpack to play well together.

A good chunk of this is applicable to any webpack-compiled frontend and Django, but we'll focus specifically on the steps involved with Vue CLI.

As a quick heads up: this tutorial assumes you're creating your Vue project in a folder named frontend inside of your Django project folder. If you want it named something else, or want it in a different folder, just update the paths accordingly.

View jenkins-docker.txt
pipeline {
environment {
registry = 'pierangelo1982/jenkinsdemo'
registryCredential = 'dockerhubpierangelo'
dockerImage = ''
}
agent any
stages {
stage('Cloning Git') {
steps {
View fattura elettronica.vba
Private Sub Comando0_Click()
Dim fSuccess As Boolean
Dim oDoc As MSXML2.DOMDocument
Dim oRoot As MSXML2.IXMLDOMNode ' Level 0 egh_eval
Dim oChild As MSXML2.IXMLDOMNode ' Level 1 eval_set
Dim oChildren As MSXML2.IXMLDOMNode ' Level 2 eval_id, eval_d, eval_e, eval_cred
Dim oChildrenChildren As MSXML2.IXMLDOMNode
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
View django_docker_script.sh
#!/bin/bash
# a script that create a docker container
MYPATH=$1
echo "USAGE: script.sh [local_path]"
# check input parameters
if [ -z "$MYPATH" ]; then
echo "Error: local path is not set"
exit
View nginx ssl docker
server {
listen 443;
server_name mydomain.com www.mydomain.com;
ssl on;
ssl_certificate /home/xxxxx/certificati/letsencrypt/live/mydomain.com/fullchain.pem;
ssl_certificate_key /home/xxxx/certificati/letsencrypt/live/mydomain.com/privkey.pem;
# Proxying the connections connections
@pierangelo1982
pierangelo1982 / DateTimeHelper.java
Created Nov 8, 2016
java/android date time helper
View DateTimeHelper.java
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
import android.util.Log;
/**
* Utility class for parsing and formatting dates and times.
*
@pierangelo1982
pierangelo1982 / extract_emails_from_text.py
Last active Jul 6, 2016 — forked from dideler/example.md
A python script for extracting email addresses from text files.You can pass it multiple files. It prints the email addresses to stdout, one address per line.For ease of use, remove the .py extension and place it in your $PATH (e.g. /usr/local/bin/) to run it like a built-in command.
View extract_emails_from_text.py
#!/usr/bin/env python
#
# Extracts email addresses from one or more plain text files.
#
# Notes:
# - Does not save to file (pipe the output to a file if you want it saved).
# - Does not check for duplicates (which can easily be done in the terminal).
#
# (c) 2013 Dennis Ideler <ideler.dennis@gmail.com>
View check_GPS_enable_android.txt
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
public class ExampleApp extends Activity {
/** Called when the activity is first created. */
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){