This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // RCTViewController.swift | |
| // Grocerest | |
| // | |
| // Created by Davide Bertola on 15/03/2017. | |
| // | |
| import Foundation | |
| import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class OptionalUseExample1 { | |
| val opt1: String? | |
| val opt2: String? | |
| val opt3: String? | |
| // ... | |
| // it's kind of repetitive to check/unwrap properties every time i use them | |
| fun work(): String { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import kotlinx.coroutines.experimental.channels.Channel | |
| import kotlinx.coroutines.experimental.delay | |
| import kotlinx.coroutines.experimental.launch | |
| import kotlinx.coroutines.experimental.runBlocking | |
| import kotlinx.coroutines.experimental.selects.select | |
| import java.util.* | |
| /* | |
| * Combine multiple channels into one `output` channel. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import kotlinx.coroutines.experimental.* | |
| import kotlinx.coroutines.experimental.channels.Channel | |
| import java.util.* | |
| /* | |
| * Structured concurrency means that child co-routines should die when their father dies | |
| * http://libdill.org//structured-concurrency.html | |
| * | |
| * In kotlin in order to have parent->child relationship you need to explicitly pass | |
| * the coroutineContext to the child coroutine. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # The script configures simultaneous AP and Managed Mode Wifi on Raspberry Pi Zero W (should also work on Raspberry Pi 3) | |
| # Usage: curl https://gist.githubusercontent.com/lukicdarkoo/6b92d182d37d0a10400060d8344f86e4/raw | sh -s WifiSSID WifiPass APSSID APPass | |
| # Licence: GPLv3 | |
| # Author: Darko Lukic <lukicdarkoo@gmail.com> | |
| # Special thanks to: https://albeec13.github.io/2017/09/26/raspberry-pi-zero-w-simultaneous-ap-and-managed-mode-wifi/ | |
| MAC_ADDRESS="$(cat /sys/class/net/wlan0/address)" | |
| CLIENT_SSID="${1}" | |
| CLIENT_PASSPHRASE="${2}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get update && sudo apt-get install -y hostapd dnsmasq iptables-persistent | |
| export DEBIAN_FRONTEND=noninteractive | |
| export ID=$(cat /sys/class/net/wlan0/address | sed 's/://g') | |
| export AP_NAME=AP_$(date +%s) | |
| export AP_PASS=raspberry | |
| export WIFI_NAME=wifi_name | |
| export WIFI_PASS=wifi_password | |
| sudo bash -c 'cat > /etc/network/interfaces.d/ap' << EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Useful Links: | |
| - http://stackoverflow.com/questions/25941171/how-to-get-gstreamer1-0-working-with-v4l2-raspicam-driver | |
| - http://raspberrypi.stackexchange.com/questions/26675/modern-way-to-stream-h-264-from-the-raspberry-cam | |
| - http://stackoverflow.com/questions/13154983/gstreamer-rtp-stream-to-vlc | |
| - http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/gst/rtp/README | |
| - http://archpi.dabase.com/#sending-and-receiving-pi-camera-video-over-the-network | |
| - http://emmanuelgranatello.blogspot.de/2013/10/raspberry-pi-gstreamer-streaming-h264.html | |
| - http://stackoverflow.com/questions/15712983/why-rtp-streaming-of-a-avi-video-file-fails-to-be-received |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Providers | |
| class Provider1 { } | |
| protocol HasProvider1 { var provider1: Provider1 { get } } | |
| class Provider2 { } | |
| protocol HasProvider2 { var provider2: Provider2 { get } } | |
| // a Provider that depends on the other two needs to be configured | |
| protocol Configurable { | |
| func configure(providerBag: HasProviders) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <network-security-config> | |
| <debug-overrides> | |
| <trust-anchors> | |
| <!-- Trust user added CAs while debuggable only --> | |
| <certificates src="user" /> | |
| </trust-anchors> | |
| </debug-overrides> | |
| </network-security-config> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Davide ---- | |
| Salve, | |
| Mi scuso per il disturbo. Ho provato a cercare chiarimenti tramite la email generica della polizia municipale ma ho ricevuto risposte che non mi sono sembrate aderenti alle mie domande. Per questo motivo ho deciso di scrivere direttamente a lei. | |
| In questi giorni molto del rumore causato dalle vicende legate alla mobilità elettrica si basano sul fatto che la polizia equipara i monopattini a motocicli. Il riferimento normativo su cui vi basate non mi sembra sia direttamente il codice della strada, ma piuttosto il "decreto del 31 | |
| gennaio 2003". Tale decreto è stato emanato per recepire una direttiva europea del 2002. | |
| Rif: https://www.asaps.it/1705-decreto_31_gennaio_2003__gu_n_123_del_29-5-2003-_suppl_ordinario_n86.html | |
| Nel 2013 però è stato emanato un altro regolamento europeo "168/2013" che è del tutto analogo alla direttiva del 2002 ma rende chiaro che i mezzi che non hanno un posto a sedere sono esclusi esattamente come i mezzi per disabili e i mezzi che costruttivamente vanno a meno di |