A bash script that will bootstrap any Python script.
Requirements
- Uses Python3
- The command is installed with the same package name as how it is invoked. For example:
pip install cmakelintallows you to runcmakelint
Usage:
| fn main() { | |
| let x = std::thread::spawn(|| { | |
| std::thread::sleep(std::time::Duration::from_secs(1)); | |
| panic!("I am crashing!"); | |
| }) | |
| .join(); | |
| println!("This result should not be visible! {x:?}"); | |
| } | |
| /// This program's output: |
| local function nmap(shortcut, command) | |
| keymap("n", shortcut, command) | |
| end | |
| nmap("<leader>P", ":PopulateQuickFixFromClipboard<CR>") | |
| vim.api.nvim_create_user_command("PopulateQuickFixFromClipboard", function() | |
| -- Grab the contents of the system clipboard | |
| local clipboard_contents = vim.fn.system("pbpaste") | |
| local clipboard_lines = vim.split(clipboard_contents, "\n", { plain = true, trimempty = true }) |
| #include <iostream> | |
| #include <map> | |
| #include <memory> | |
| struct X { | |
| X(int x) : x(x) {} | |
| int x; | |
| }; | |
| typedef std::multimap<int, std::shared_ptr<X>> Map; |
| /* | |
| https://projecteuler.net/problem=19 | |
| 1 Jan 1900 was a Monday. | |
| Thirty days has September, | |
| April, June and November. | |
| All the rest have thirty-one, | |
| Saving February alone, | |
| Which has twenty-eight, rain or shine. | |
| And on leap years, twenty-nine. |
| /********************************************************************************************** | |
| * | |
| * raylib 32x32 game/demo competition | |
| * | |
| * Competition consist in developing a videogame in a 32x32 pixels screen size. | |
| * | |
| * LICENSE: zlib/libpng | |
| * | |
| * Copyright (c) 2020 Will Bradley (@wbbradley) | |
| * |
| function column-sum() { | |
| column=$1 | |
| delim=${2:-','} | |
| awk -F "$delim" ' | |
| BEGIN { sum=0 } | |
| { sum += $'"$column"' } | |
| END { print sum } | |
| ' | |
| } | |
| function column-only-above() { |
| /********************************************************************************************** | |
| * | |
| * raylib 32x32 game/demo competition | |
| * | |
| * Competition consist in developing a videogame in a 32x32 pixels screen size. | |
| * | |
| * RULES: | |
| * | |
| * 1) Use only raylib (and included libraries), no external libraries allowed | |
| * 2) The submission should consist of just one source file |
| tests/test_for_loop.zion:1:4: test_for_loop.main = (λ_.let __v16 = (std.iter let __range_min__v13 = 1 in let __range_next__v14 = (std.+ 1 __range_min__v13) in let __range_max__v15 = 10 in (std.Range __range_min__v13 (std.- __range_next__v14 __range_min__v13) __range_max__v15)) in (while std.True match (__v16 ()) (std.Just(x) std.print x) (std.Nothing (break!)))) :: () -> std.ExitCode | |
| src/parser.cpp:411:1: std.+ = __builtin_add_int :: Int -> Int -> Int | |
| src/parser.cpp:393:1: std.- = __builtin_subtract_int :: Int -> Int -> Int | |
| tests/test_for_loop.zion:2:16: std.Range = (λ__v10.return! (λ__v11.return! (λ__v12.return! ((__v10, __v11, __v12) as! std.Range Int)))) :: Int -> Int -> Int -> std.Range Int | |
| tests/test_for_loop.zion:2:11: std.True = ((1,) as! std.Bool) :: std.Bool | |
| tests/test_for_loop.zion:2:11: std.iter = (λri.let index = (std.Ref (std.__get_range_min ri)) in (return! (λ_.let cur_index = (std.load_value index) in (if (std.<= cur_index (std.__get_range_max ri)) then ({__builtin_store index (std.+ cur_index |