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
import matplotlib.pyplot as plt | |
import numpy as np | |
x = np.linspace(-np.pi,np.pi,100) | |
y = np.sin(x) | |
fig = plt.figure() | |
ax = fig.add_subplot(1, 1, 1) | |
ax.spines['left'].set_position('center') | |
ax.spines['bottom'].set_position('center') | |
ax.spines['right'].set_color('none') | |
ax.spines['top'].set_color('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
from github import Github | |
g_cred = Github("<Paste Your Token Here>") | |
f_repo = input("Enter repository name to see its stars (eg. user/repo): ") | |
repo = g_cred.get_repo(f_repo) | |
print(repo.stargazers_count) |
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 tkinter import * | |
from langdetect import * | |
from iso639 import languages | |
root = Tk() | |
root.title("Language Detector") | |
root.geometry("400x480") | |
def language_detection(): | |
text = T.get("1.0", 'end-1c') | |
language_code = languages.get(alpha2=detect(text)) | |
l_d.config(text="Language Detected: "+language_code.name) |
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 forex_python.converter import CurrencyRates | |
import time | |
cr = CurrencyRates() | |
amount = int(input("Enter the amount you want to convert: ")) | |
time.sleep(1) | |
from_currency = input("Enter the currency code to be converted: ").upper() | |
time.sleep(1) | |
to_currency = input("Enter the currency code to convert to: ").upper() | |
time.sleep(1) |
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
import pyjokes | |
import time | |
print ("10 geeky jokes to have you cracking up: \n") | |
time.sleep(1.5) | |
jokes = pyjokes.get_jokes(language='en', category='neutral') | |
for i in range(10): | |
print(i+1,':',jokes[i]) | |
time.sleep(2) |
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
def crown(length, height): | |
for i in range(0, height): | |
for j in range(0, length): | |
if i == 0: | |
print(" ", end = "") | |
elif i == height - 1: | |
print("-", end = "") | |
elif ((j < i or j > height - i) and | |
(j < height + i or | |
j >= length - i)) : |
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 gpiozero import Robot | |
from time import sleep | |
robot = Robot(left = (7, 8), right = (9, 10)) | |
while True: | |
robot.forward() | |
sleep(2) | |
robot.stop() | |
robot.right() | |
sleep(2) | |
robot.stop() |
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
const fs = require("fs") | |
const strip = require("strip-comments") | |
const prettier = require("prettier") | |
var glob = require("glob") | |
try { | |
glob("**/*.js", { ignore: "**/node_modules/**" }, function (error, files) { | |
files.forEach((element) => { | |
var file = fs.openSync(element, "r+") | |
var data = fs.readFileSync(file, "utf8") |
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
<?php | |
function printCollatz($n) | |
{ | |
while ($n != 1) | |
{ | |
echo $n . " "; | |
if ($n & 1) | |
$n = 3 * $n + 1; | |
else | |
$n = $n / 2; |
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
import json | |
import turtle | |
import urllib.request | |
import time | |
import webbrowser | |
import geocoder | |
url = "http://api.open-notify.org/astros.json" | |
response = urllib.request.urlopen(url) | |
result = json.loads(response.read()) |
NewerOlder