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
| fn solution(s: &str) -> Vec<String> { | |
| let mut pile_of_strings = Vec::new(); | |
| let slice: &[char] = &s.chars().collect::<Vec<_>>()[..]; | |
| for piece in slice.chunks(2) { | |
| if piece.len() > 1 { | |
| pile_of_strings.push(piece.iter().collect()); | |
| } else { | |
| // let squished : &str = &[piece,&['_']].concat(); | |
| pile_of_strings.push(&[piece, &['_']].concat().iter().collect()); |
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
| module Splitty where | |
| splitty :: String -> [String] | |
| splitty [] = [] | |
| splitty [c] = [[c, '_']] | |
| splitty (a : b : cs) = [[a, b]] <> splitty cs |
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
| ;; timer variable | |
| (defvar idle-timer-show-org-agenda-timer nil) | |
| ;; start function | |
| (defun se/idle-timer-show-org-agenda-start () | |
| (interactive) | |
| (when (timerp idle-timer-show-org-agenda-timer) | |
| (cancel-timer idle-timer-show-org-agenda-timer)) | |
| (setq idle-timer-show-org-agenda-timer | |
| (run-with-idle-timer (* 30 60) 1 #'org-agenda-list))) |
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 | |
| import board | |
| import pwmio | |
| led = pwmio.PWMOut(board.A1, frequency=5000, duty_cycle=0) | |
| while True: | |
| for i in range(100): | |
| # PWM LED up and down | |
| if i < 50: |
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
| # SPDX-FileCopyrightText: Copyright (c) 2022 Dan Halbert for Adafruit Industries | |
| # | |
| # SPDX-License-Identifier: MIT | |
| """ | |
| `adafruit_httpserver` | |
| ================================================================================ | |
| Simple HTTP Server for CircuitPython | |
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
| # SPDX-FileCopyrightText: 2022 Dan Halbert for Adafruit Industries | |
| # | |
| # SPDX-License-Identifier: Unlicense | |
| from secrets import secrets # pylint: disable=no-name-in-module | |
| from rainbowio import colorwheel | |
| import binascii | |
| import board | |
| import microcontroller |
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
| module Demo where | |
| -- notice many of these don't have type signatures. | |
| -- Haskell is smart enough figure out 99% of the type signatures for you. | |
| -- any type signatures here are just to add clarity. | |
| -- number | |
| somenumber = 1 | |
| -- string |
This file has been truncated, but you can view the full file.
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
| Up to date | |
| 320205218: cap 0: running thread 14 | |
| 320219671: cap 0: stopping thread 14 (thread yielding) | |
| 320220960: cap 0: running thread 14 | |
| 320226864: cap 0: stopping thread 14 (making a foreign call) | |
| 320270050: cap 0: requesting parallel GC | |
| 322755595: cap 0: starting GC | |
| 322765713: cap 0: GC working | |
| 322927933: cap 0: GC idle | |
| 322931427: cap 0: GC working |
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
| virtualisation.oci-containers = { | |
| backend = "docker"; | |
| containergs = { | |
| our-container-image = { | |
| autoStart = false; | |
| image = "our-container-image"; | |
| imageFile = pkgs.dockerTools.buildImage { | |
| name = "our-container-image"; | |
| contents = with pkgs; [ git git-lfs gitlab-runner ]; | |
| }; |
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
| #!/usr/bin/env cabal | |
| {- cabal: | |
| build-depends: base | |
| , QuickCheck | |
| -} | |
| module Main where | |
| import Test.QuickCheck |