Skip to content

Instantly share code, notes, and snippets.

View amireshoon's full-sized avatar
🎲

Amirhossein Meydani amireshoon

🎲
View GitHub Profile
@amireshoon
amireshoon / pnums.go
Last active August 14, 2020 11:43
Creating file and main content
package main
func main() {
}
@amireshoon
amireshoon / pnums.go
Created August 14, 2020 11:46
Reading input
package main
import "bufio"
func main() {
reader := bufio.NewReader(os.Stdin)
a, err := reader.ReadString('\n')
if err != nil {
panic("input error")
}
@amireshoon
amireshoon / pnums.go
Created August 14, 2020 11:49
Creating loop
package main
import "bufio"
func main() {
reader := bufio.NewReader(os.Stdin)
a, err := reader.ReadString('\n')
if err != nil {
panic("input error")
}
@amireshoon
amireshoon / pnums.go
Created August 14, 2020 11:51
Final figure
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
@amireshoon
amireshoon / app.go
Created September 3, 2020 12:42
Calculate BMI
package main
func main() {
}
@amireshoon
amireshoon / app.go
Created September 3, 2020 12:48
BMI
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
@amireshoon
amireshoon / app.go
Created September 3, 2020 12:51
BMI
f := i2 * i2
bmi := float64(i) / f
@amireshoon
amireshoon / app.go
Created September 3, 2020 12:52
BMI
if bmi < 18.5 {
fmt.Println(bmi)
fmt.Println("Underweight")
} else if bmi < 25 {
fmt.Println(bmi)
fmt.Println("Normal")
} else if bmi < 30 {
fmt.Println(bmi)
fmt.Println("Overweight")
} else if 30 < bmi {
@amireshoon
amireshoon / app.go
Created September 3, 2020 12:53
BMI
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
@amireshoon
amireshoon / strea.py
Created December 4, 2020 12:33
Stream a youtube live in python with pafy and vlc
import pafy
import vlc
url = "https://www.youtube.com/watch?v=5qap5aO4i9A"
video = pafy.new(url)
best = video.getbest()
playurl = best.url
Instance = vlc.Instance()
player = Instance.media_player_new()