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 java.util.zip.ZipInputStream | |
| def zipStream(zis: ZipInputStream, buffer: Array[Byte]): Stream[(String, Array[Byte])] = { | |
| val maybeEntry = Option(zis.getNextEntry); | |
| maybeEntry match { | |
| case Some(entry) => | |
| val size = zis.read(buffer, 0, buffer.size) | |
| (entry.getName, buffer.take(size)) #:: zipStream(zis, buffer) | |
| case None => Stream.empty | |
| } |
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 $ivy.`com.typesafe:config:1.4.0` | |
| import com.typesafe.config.ConfigFactory | |
| import scala.collection.JavaConverters._ | |
| ConfigFactory.parseString(repl.clipboard.read) | |
| .entrySet.asScala.map(_.getKey).toSeq.sorted | |
| .filter(_.contains("timeout")) |
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
| var l = Vector.empty[String] | |
| val c = '"' | |
| def doit(p: => Unit) { | |
| p | |
| val ll = "doit {" +: l :+ "}" | |
| print(ll.mkString("\n")) | |
| } | |
| def myprint(x: Any) { | |
| l = l :+ s"myprint($c$c$c$x$c$c$c)" | |
| println(x) |
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/bash | |
| # | |
| # ./handleMemoriesUploads.sh /srv/uploads/digitalmemories /mnt/external/managedark/digitalmemories /srv/enc/clear/digitalmemories/ /srv/enc/ciphered/digitalmemories/ amazonDrive:/backup/memories false | |
| # ./handleMemoriesUploads.sh /srv/uploads/digitalmemories /mnt/external/managedark/digitalmemories /srv/enc/clear/digitalmemories/ /srv/enc/ciphered/digitalmemories/ s3:orionsmemories | |
| # | |
| SOURCE_DIR=$1 | |
| LOCAL_DEST=$2 | |
| ENC_IN=$3 | |
| ENC_OUT=$4 | |
| RCLONE_SYNC_DEST=$5 |
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
| package main | |
| // https://go.dev/doc/tutorial/generics | |
| import "fmt" | |
| func receiveSlice[V interface{}](theSlice []V) []V { | |
| ret := make([]V, len(theSlice)) | |
| for i, value := range theSlice { | |
| ret[i] = value |
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
| # https://www.europarl.europa.eu/plenary/en/votes.html?tab=votes | |
| curl https://www.europarl.europa.eu/doceo/document/PV-9-2022-03-01-RCV_FR.xml |\ | |
| xq . |\ | |
| jq '."PV.RollCallVoteResults"."RollCallVote.Result"[] | {"description": ."RollCallVote.Description.Text"."#text", "votes": ."Result.Against"."Result.PoliticalGroup.List"[]}' | |
| cat /tmp/votes.json | jq '."PV.RollCallVoteResults"."RollCallVote.Result"[] | select(."RollCallVote.Description.Text"."#text" == "- Après le § 37 - Am 21")| {"description": ."RollCallVote.Description.Text"."#text", "votes": ."Result.For"."Result.PoliticalGroup.List"[]}' | jq '.votes | ."@Identifier", (."PoliticalGroup.Member.Name" | length)' -r |
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/bash | |
| # | |
| # ./handleMemoriesUploads.sh /srv/uploads/digitalmemories /mnt/external/managedark/digitalmemories /srv/enc/clear/digitalmemories/ /srv/enc/ciphered/digitalmemories/ azureDrive:/backup/memories false | |
| # | |
| SOURCE_DIR=$1 | |
| LOCAL_DEST=$2 | |
| ENC_IN=$3 | |
| ENC_OUT=$4 | |
| RCLONE_SYNC_DEST=$5 | |
| SKIP_UPLOAD=$6 |
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
| zk_version 3.7.0-e3704b390a6697bfdf4b0bef79e3da7a4f6bac4b, built on 2021-03-17 09:46 UTC | |
| zk_server_state leader | |
| zk_peer_state leading - broadcast | |
| zk_ephemerals_count 80 | |
| zk_num_alive_connections 6 | |
| zk_avg_latency 0.5714 | |
| zk_min_proposal_size 36 | |
| zk_outstanding_requests 0 | |
| zk_znode_count 508 | |
| zk_global_sessions 53 |
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 time | |
| from machine import Pin, PWM | |
| pwm = PWM(Pin(4)) | |
| pwm.freq(50) | |
| def demo(): | |
| st = False | |
| for x in range(1,10): | |
| if st: | |
| pwm.duty_u16(int(65536*0.5/20)) | |
| else: |
OlderNewer