Skip to content

Instantly share code, notes, and snippets.

View loudambiance's full-sized avatar

Daniel Baucom loudambiance

View GitHub Profile

Keybase proof

I hereby claim:

  • I am loudambiance on github.
  • I am danielbaucom (https://keybase.io/danielbaucom) on keybase.
  • I have a public key whose fingerprint is 63D6 70A5 6D07 2354 CE75 7B64 D986 0E6A F0EC 56EA

To claim this, I am signing this object:

this:
<asp:RadioButtonList ID="SexList" runat="server" TextAlign="Left" RepeatDirection="Horizontal" ValidationGroup="BMIValid">
<asp:ListItem Text="Female" value="1"></asp:ListItem>
<asp:ListItem Text="Male" value="2"></asp:ListItem>
</asp:RadioButtonList>
Generates:
<table id="SexList">
<tbody><tr>
<td><label for="SexList_0">Female</label><input id="SexList_0" type="radio" name="SexList" value=""></td>
#!/usr/bin/env python3
import urllib.request, json
from sys import argv
if(len(argv) > 1):
with urllib.request.urlopen("https://api.spigotmc.org/simple/0.1/index.php?action=getResource&id="+argv[1]) as url:
data = json.loads(url.read().decode())
print("Downloads: " + data["stats"]["downloads"])
print("Updates: " + data["stats"]["updates"])
print("Reviews: " + data["stats"]["reviews"])
#!/usr/bin/env python3
import urllib.request, json
from sys import argv
if(len(argv) > 1):
url = "https://bstats.org/api/v1/plugins/"+argv[1]+"/charts/servers/data"
req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
html = urllib.request.urlopen(req).read()
serversdata = json.loads(html.decode())
#print(data)
#!/usr/bin/python3
import discord
class MyClient(discord.Client):
async def on_ready(self):
print('Logged in as')
print(self.user.name)
print(self.user.id)
print('------')
@loudambiance
loudambiance / flicker.py
Last active November 1, 2022 15:05
kasa flicker using python-kasa
import asyncio
from kasa import SmartBulb
from random import *
async def main():
previous=100;
current=100;
bulb = SmartBulb("192.168.1.179")
while True:
y = randint(0,1)
with open('task1a.txt') as f:
lines = f.read().splitlines()
count = 0
prev = None
for line in lines:
if prev is not None and int(line) > int(prev):
print("++ {}:{}".format(prev,line))
count = count + 1
else:
with open('task1b.txt') as f:
lines = f.read().splitlines()
count = 0
a = lines.pop(0)
b = lines.pop(0)
c = lines.pop(0)
for line in lines:
sum1 = int(a) + int(b) + int(c)
sum2 = int(b) + int(c) + int(line)
with open('task2a.txt') as f:
lines = f.read().splitlines()
x = 0
y = 0
aim = 0
for line in lines:
tmp = line.split(" ")
if tmp[0] == 'forward':
x = x + int(tmp[1])
with open('task2a.txt') as f:
lines = f.read().splitlines()
x = 0
y = 0
for line in lines:
tmp = line.split(" ")
if tmp[0] == 'forward':
x = x + int(tmp[1])
elif tmp[0] == 'up':