$ docker build -t localhost:5000/myapp . --push
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
--[[ | |
===================================================================== | |
==================== READ THIS BEFORE CONTINUING ==================== | |
===================================================================== | |
Kickstart.nvim is *not* a distribution. | |
Kickstart.nvim is a template for your own configuration. | |
The goal is that you can read every line of code, top-to-bottom, understand |
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
# ruby 3+ | |
# gem install test-unit | |
require 'test/unit/assertions' | |
include Test::Unit::Assertions | |
def balanced?(input) | |
delimiters = { | |
"(" => ")", | |
"{" => "}", | |
"[" => "]" |
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
FROM --platform=linux/amd64 ubuntu | |
RUN apt-get update | |
RUN apt-get install make binutils build-essential -y | |
RUN apt-get install nasm gdb strace -y | |
WORKDIR /app |
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
use std::{thread, sync::{Arc, Mutex, Condvar}}; | |
struct BlockingQueue<T> { | |
store: Mutex<Vec<T>>, | |
emitter: Condvar, | |
} | |
impl<T> BlockingQueue<T> { | |
fn new() -> BlockingQueue<T> { | |
Self { |
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
fn main() { | |
// 1. Singly Linked List (using Box) | |
{ | |
println!("1. Singly Linked List (using Box)"); | |
struct Node<T> { | |
value: T, | |
next: Option<Box<Node<T>>>, | |
} | |
let mut head = Box::new(Node { value: 1, next: None }); |
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
fn main() { | |
println!("This is a demonstration of ownership, borrowing and smart pointers in Rust."); | |
// 1. Data on the stack (fixed size) | |
{ | |
println!("Data on the stack (fixed size):"); | |
let age: i32 = 42; | |
println!("Age: {}", age); | |
// Transfer ownership: Copy |
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
use std::sync::{Arc, Mutex}; | |
use std::sync::Condvar; | |
use std::thread; | |
use std::collections::HashMap; | |
use std::time::Duration; | |
struct Node<T> { | |
value: T, | |
next: Option<Arc<Mutex<Node<T>>>>, | |
previous: Option<Arc<Mutex<Node<T>>>>, |
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
// A UNIX socket server written in pure Rust | |
use std::io::Read; | |
use std::os::unix::net::{UnixListener, UnixStream}; | |
use std::path::Path; | |
fn main() { | |
let socket = Path::new("/tmp/echo.sock"); | |
if socket.exists() { |
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
// A UNIX socket server written in Go, using the net package. | |
package main | |
import ( | |
"fmt" | |
"net" | |
"os" | |
) |
NewerOlder