Skip to content

Instantly share code, notes, and snippets.

View Andygmb's full-sized avatar

Andy Andygmb

  • Amsterdam, Netherlands
View GitHub Profile
import win32gui
import win32ui
from ctypes import windll
from PIL import Image
def get_hwnd_from_string(hwnd_string):
hwnd = win32gui.FindWindowEx(None, 0, None, hwnd_string)
return hwnd
def screengrab(hwnd):
CoordMode, Mouse, Screen
ICON_NAMES := "|agility|construction|cooking|crafting|farming|firemaking|fishing|fletching|herblore|hunter|magic|mining|prayer|ranged|runecrafting|slayer|smithing|summoning|thieving|woodcutting"
StringSplit, ICON_NAMES, ICON_NAMES, |
PTOKEN := Gdip_Startup()
PAGILITY := Gdip_CreateBitmapFromFile("agility.gif")
PCONSTRUCTION := Gdip_CreateBitmapFromFile("construction.gif")
def winner(votes):
return max(votes, key = votes.count)
winner([1,1,2,2,2,2,2,3])
>>> 2
var circle = $(".circle")
$("a").on("click", function(e){
e.preventDefault()
var url = this.href
$.ajax({
url:url,
success:function(response){
if (response === "True") {
$("a").on("click", function(e){
e.preventDefault()
url = this.href
$.ajax({
url:url,
success:function(response){
if (response === "True") {
$(".circle").css("background-color", "green")
} else {
<html>
<head>
<script src="https://code.jquery.com/jquery-1.11.2.js"></script>
</head>
<body>
<a href="/red/1"><button> Click me to turn red on</button></a>
<a href="/red/0"><button> Click me to turn red off</button></a>
<script>
$("a").on("click", function(e){
e.preventDefault()
<html>
<head>
<script src="https://code.jquery.com/jquery-1.11.2.js"></script>
</head>
<body>
<a href="/red/1"><button> Click me to turn red on</button></a>
<a href="/red/0"><button> Click me to turn red off</button></a>
<script>
$("button").on("click", function(e){
e.preventDefault()
<html>
<head>
<script src="https://code.jquery.com/jquery-1.11.2.js"></script>
<script>
$("button").on("click", function(e){
e.preventDefault()
})
</script>
</head>
<body>
<html>
<head>
<script src="https://code.jquery.com/jquery-1.11.2.js"></script>
<script>
$("button").on("click", function(e){
e.preventDefault()
})
</script>
</head>
<body>
<script>
$(button).on("click", function(e){
e.preventDefault()
})
</script>