Skip to content

Instantly share code, notes, and snippets.

@sksat
Created December 24, 2020 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sksat/7e0864d6bea67f908ecbf67bf19613f0 to your computer and use it in GitHub Desktop.
Save sksat/7e0864d6bea67f908ecbf67bf19613f0 to your computer and use it in GitHub Desktop.
FizzBuzz
import os
os.system("""
bash << EOS
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env;cargo new fizzbuzz;cd fizzbuzz
echo Zm4gbWFpbigpe2ZvciBpIGluIDEuLjEwMXttYXRjaChpJTMsaSU1KXsoMCwgMCkgPT4gcHJpbnRsbiEoIkZpenpCdXp6IiksKDAsIF8pID0+IHByaW50bG4hKCJGaXp6IiksKF8sIDApPT5wcmludGxuISgiQnV6eiIpLF89PnByaW50bG4hKCJ7fSIsIGkpLH19fQo= | base64 -d > src/main.rs
cargo run
EOS
""")
@sksat
Copy link
Author

sksat commented Dec 24, 2020

curl -L 'https://git.io/JLXFS' | python3

@sksat
Copy link
Author

sksat commented Dec 28, 2020

.ONESHELL:

SHELL=python
SHELLFLAGS=

.PHONY: fizzbuzz

fizzbuzz:
	import os
	os.system("""
	bash << EOS
	curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
	source $$HOME/.cargo/env;cargo new fizzbuzz;cd fizzbuzz
	echo Zm4gbWFpbigpe2ZvciBpIGluIDEuLjEwMXttYXRjaChpJTMsaSU1KXsoMCwgMCkgPT4gcHJpbnRsbiEoIkZpenpCdXp6IiksKDAsIF8pID0+IHByaW50bG4hKCJGaXp6IiksKF8sIDApPT5wcmludGxuISgiQnV6eiIpLF89PnByaW50bG4hKCJ7fSIsIGkpLH19fQo= | base64 -d > src/main.rs
	cargo run
	EOS
	""")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment