This file contains 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 staq: | |
def __init__(self, stack = []): | |
self.enqstk = stack | |
self.deqstk = [] | |
def _swap(self): | |
if len(self.deqstk) == 0: | |
while len(self.enqstk) > 0: | |
_pus(self.deqstk, _pop(self.enqstk)) | |
def enq(self, item): | |
_pus(self.enqstk, item) |
This file contains 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 Data.String.Utils (replace) | |
import Data.Char (isUpper, toUpper) | |
import System.Environment (getArgs) | |
main :: IO () | |
main = do | |
strings <- getArgs | |
mapM_ (putStrLn . pronounify) strings | |
capitalise :: String -> String |
This file contains 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 | |
# Author: Zoey Llewellyn "Zobean" Hewll | |
# | |
# Usage: fix-git [REMOTE-URL] | |
# Must be run from the root directory of the repository. | |
# If a remote is not supplied, it will be read from .git/config | |
# | |
# For when you have a corrupted local repo, but a trusted remote. | |
# This script replaces all your history with that of the remote. |
This file contains 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 Data.List (intercalate) | |
-- takes n from the start of a list and puts them at the end | |
wrap :: Int -> [a] -> [a] | |
wrap 0 xs = xs | |
wrap _ [] = [] | |
wrap n (x:xs) | |
| n > 0 = wrap (n-1) (xs ++ [x]) | |
| otherwise = undefined -- cannot move backward through the list |
This file contains 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
#![feature(cell_update)] | |
#[cfg(test)] | |
mod test { | |
use crate::*; | |
use std::cell::Cell; | |
#[test] | |
fn test() { | |
test_counter::<0>(); |