Skip to content

Instantly share code, notes, and snippets.

View Nikitaw99's full-sized avatar

Nikitaw99 Nikitaw99

  • Russia
View GitHub Profile
@Nikitaw99
Nikitaw99 / LICENSE.txt
Last active January 5, 2022 23:07
simple command prompt theme in simple html and css
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
import discord
import asyncio
client = discord.Client()
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name )
print(client.user.id)
@Nikitaw99
Nikitaw99 / time.py
Created March 3, 2017 18:13
discord.py time command (based on orangestation-bot)
elif message.content.startswith("AI, time"):
# UTC
tmp1 = datetime.datetime.now()
utcnow = datetime.time(hour=tmp1.hour, minute=tmp1.minute, second=tmp1.second)
del tmp1
utcfulltime = "{}:{}:{}".format(utcnow.hour, utcnow.minute, utcnow.second)
# SMT
tmp1 = datetime.timedelta(hours=4)
smt = datetime.timezone(tmp1)
import discord
import asyncio
import textile
client = discord.Client()
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name )
@Nikitaw99
Nikitaw99 / microcont.lua
Last active March 23, 2017 18:49
sample microcontroller program for opencomputers minecraft mod. when it receives a redstone signal in the front, it beeps
local rs = component.proxy(component.list("redstone")())
while true do
if rs.getInput(3) > 0 then
computer.beep()
end
computer.pullSignal()
end
@Nikitaw99
Nikitaw99 / bad_heaven.py
Created March 5, 2017 19:11
python3 bad_heaven.py
bad = open("bad_lyrics.txt", mode="r").read()
heaven = open("heaven_lyrics.txt", mode="r").read()
new = open("new_lyrics.txt", mode="w")
bad = bad.replace("bad", heaven)
new.write(bad)
new.close()
@Nikitaw99
Nikitaw99 / test.py
Created March 5, 2017 11:58
testing `unittest`
def say_hi(name='World'):
if name == None or name == '':
name = "World"
if type(name) != str:
name = str(name)
return f"Hello, {name}!"
@Nikitaw99
Nikitaw99 / DatBoi.rb
Last active January 9, 2017 10:35
messing around with ruby
require "date"
class DatBoi
attr_accessor :name
attr_accessor :life
attr_accessor :bornIn
attr_accessor :currentDate
attr_accessor :alive
def initialize(name = "Dat Boi", life = 365*4, bornIn = Date.parse("2016-04-03"))
@name = name
@life = life
[scenario]
id=chapter1
next_scenario=chapter2
name=Chapter 1 - The Port In Ruins
map_data="{~add-ons/The_Invasion/scenarios/maps/prologue.map}"
turns=27
{DEFAULT_SCHEDULE}
@Nikitaw99
Nikitaw99 / fe-calc.lua
Created September 4, 2016 19:23
Simple Fire Emblem battle simulator.
math.randomseed(os.time())
print("Enter attacker skill stat:")
skill = io.read('*n')
while skill > 100 or skill < 0 do
print("This number is invalid.")
print("The number must be between 0 and 100.")
print("Enter attacker skill stat:")
skill = io.read('*n')
end