Skip to content

Instantly share code, notes, and snippets.

Avatar

Nikitaw99 Nikitaw99

View GitHub Profile
@Nikitaw99
Nikitaw99 / microcont.lua
Last active Mar 23, 2017
sample microcontroller program for opencomputers minecraft mod. when it receives a redstone signal in the front, it beeps
View microcont.lua
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 Mar 5, 2017
python3 bad_heaven.py
View 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 Mar 5, 2017
testing `unittest`
View test.py
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 / time.py
Created Mar 3, 2017
discord.py time command (based on orangestation-bot)
View time.py
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)
@Nikitaw99
Nikitaw99 / DatBoi.rb
Last active Jan 9, 2017
messing around with ruby
View DatBoi.rb
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
View chapter1.cfg
[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 Sep 4, 2016
Simple Fire Emblem battle simulator.
View fe-calc.lua
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
View selfbot.py
import discord
import asyncio
import textile
client = discord.Client()
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name )
View eval_selfbot.py
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)
View calculate.cpp
#include <iostream>
int getUserInput() {
std::cout << "Please input an integer: ";
int value;
std::cin >> value;
return value;
}
int getMathematicalOperation() {
You can’t perform that action at this time.