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
main() { | |
szoveg = scanf | |
while (!validate(szoveg)) { | |
szoveg = scanf | |
} | |
} | |
// do stuff |
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 feedparser | |
url = "http://cdn.koponyeg.hu/img/rss/idojaras_rss_regio_4.xml" | |
def get_actual_weather(): | |
try: | |
feed = feedparser.parse(url) | |
# aktualis | |
telepules = feed['items'][0]['koponyeg_jelenido']['allomas'] |
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 requests | |
url = "http://api.icndb.com/jokes/random" | |
def get_chuck_norris_joke(): | |
response = requests.get(url) | |
joke = dict(response.json()) | |
return joke['value']['joke'] |
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
#python3 -m pip install pyowm | |
# | |
import pyowm | |
# I changed one character :D have fun finding it | |
api_key = "fd64c4e513be8dfaee03be4e9a04948" | |
def get_forcast_for_city(city): | |
owm = pyowm.OWM(api_key) # You MUST provide a valid API key |
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 requests, json | |
from time import sleep | |
def getBitcoinPrice(): | |
URL = 'https://www.bitstamp.net/api/ticker/' | |
try: | |
r = requests.get(URL) | |
priceFloat = float(json.loads(r.text)['last']) | |
return priceFloat | |
except requests.ConnectionError: |
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
[Unit] | |
Description=Git hook service | |
[Service] | |
Type=simple | |
Restart=always | |
ExecStart=/usr/bin/python3 /home/sovietspy2/www/Phaser3GamePublisher/api.py | |
[Install] | |
WantedBy=multi-user.target |
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
// emails should be an array of strings | |
export default function validateEmails(emails) { | |
const regex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
const validAll = cleanedEmails.every( x => regex.test(x)); | |
return validAll; | |
} |
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
// https://labs.phaser.io/edit.html?src=src\plugins\add%20scene%20plugin%20in%20config.js | |
var config = { | |
type: Phaser.AUTO, | |
parent: 'phaser-example', | |
width: 800, | |
height: 600, | |
scene: { | |
preload: preload, | |
create: create, |
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
//usage: node csvtojson.js <filename.csv> | |
//output: <filename>.json | |
const fs = require('fs'); | |
const originalFileName = process.argv[2]; | |
const newFileName = originalFileName.split(".")[0] + ".json"; | |
console.log("new file name is :",newFileName); |
OlderNewer