Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View stoiandan's full-sized avatar

Stoian Dan stoiandan

  • Romania
View GitHub Profile
@stoiandan
stoiandan / multicast.rs
Last active April 19, 2024 22:51
Rust multicast
use std::net::{Ipv6Addr, SocketAddr, UdpSocket};
use std::str::FromStr;
use std::thread;
fn main() {
// Create a IPv6 multicast address
let multicast_addr =
Ipv6Addr::from_str("ff02::11").expect("Could not create multicast address");
#!/bin/sh
# Get notified when you favorite cars are avlailbe!
URL="https://www.autovit.ro/autoturisme/de-la-2017\?search%5Bfilter_enum_damaged%5D\=0\&search%5Bfilter_enum_gearbox%5D\=automatic\&search%5Bfilter_enum_keyless_entry%5D\=1\&search%5Bfilter_enum_keyless_go%5D\=1\&search%5Bfilter_enum_no_accident%5D\=1\&search%5Bfilter_enum_original_owner%5D\=1\&search%5Bfilter_enum_pollution_standard%5D\=euro-6\&search%5Bfilter_float_mileage%3Ato%5D\=125000\&search%5Bfilter_float_price%3Ato%5D\=11000\&search%5Badvanced_search_expanded%5D\=true"
RESULT=$(eval curl -s $URL | grep -ic "Nu sunt rezultate")
if [ $RESULT -eq 0 ]; then
# if macOS show a dialog on screen
if [ $OSTYPE[1,6] = 'darwin' ]; then
import Foundation
class Rod {
fileprivate var stack = [Int]()
public func stackOnTop(diskSize newDiskSize: Int) throws {
if let topDiskSize = stack.popLast() {