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
| const std = @import("std"); | |
| /// a linear singly linked list that is managed with an allocator | |
| pub fn LinkedList(comptime T: type) type { | |
| return struct { | |
| const Self = @This(); | |
| const Node = struct { | |
| data: T, | |
| next: ?*Node = null, |
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
| const std = @import("std"); | |
| const ArrayList = std.ArrayList; | |
| /// Returns the matches to a provided filter fn for an ArrayList, as a new ArrayList | |
| /// of the same type, _without_ transforming the original list. | |
| /// | |
| /// _Params_: | |
| /// `T`: item type for `list` -> ArrayList(`T`) | |
| /// | |
| /// `list`: ArrayList to filter on |
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
| # This is a super **SIMPLE** example of how to create a very basic powershell webserver | |
| # 2019-05-18 UPDATE — Created by me and and evalued by @jakobii and the comunity. | |
| # Http Server | |
| $http = [System.Net.HttpListener]::new() | |
| # Hostname and port to listen on | |
| $http.Prefixes.Add("http://localhost:8080/") | |
| # Start the Http Server |
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 | |
| # Configure NPM for Global Installation | |
| # Tested on Ubuntu Budgie 18.10 | |
| if [[ $( ls -a ~ | grep .npm-global ) ]]; then | |
| echo ".npm-global dir already exists, skipping" | |
| else | |
| echo "creating dir for npm installs in $HOME" | |
| mkdir ~/.npm-global # make a dir for installs | |
| fi |