Skip to content

Instantly share code, notes, and snippets.

View Uberi's full-sized avatar

Anthony Zhang Uberi

View GitHub Profile
@maestrith
maestrith / Socket.ahk
Created November 11, 2013 10:25
Posted using AHK Studio
#SingleInstance,Force
sock:=new socket()
sock.connect("irc.freenode.net",6667)
size:=0
Gui,Add,ListView,w800 h800,Text
Gui,show
LV_Add("",sock.sendtext("NICK maestrith1"))
LV_Add("",sock.sendtext("USER maestrith1 0 * :maestrith1"))
while,A_Index<4{
LV_Add("",sock.recvtext())
@aviaryan
aviaryan / mathstestscript.ahk
Last active December 17, 2015 11:08
Maths Test Script -
SetWorkingDir %A_ScriptDir%
var = sqrt(4) - [892839.2382389 - 89238239.923]
msgbox,% SM_Solve(var)
msgbox,% SM_Solve("log(2) + log(3) + log(4) - 23898238239.32 * 3282398239238.92382 / 892382938239.8923")
msgbox,% SM_Solve("Sqrt(4) * 2 * log(100) / 32")
msgbox,% SM_UniquePmt("avi,annat,koiaur,aurkoi") ;no of permutation = 24
msgbox,% SM_UniquePmt("abd", 3) ;no of permutation = 6
msgbox,% SM_UniquePmt("abcdefghijklmnop",2)
@pudquick
pudquick / webclip.py
Created November 22, 2012 10:09
Create webclippings in Pythonista
import uuid, BaseHTTPServer, select, types, clipboard, console
from SimpleHTTPServer import SimpleHTTPRequestHandler
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
global mobile_config_str
mobile_config_str = ''
@omz
omz / FileTransfer.py
Last active September 6, 2024 01:50
File Transfer script for Pythonista (iOS)
# File Transfer for Pythonista
# ============================
# This script allows you to transfer Python files from
# and to Pythonista via local Wifi.
# It starts a basic HTTP server that you can access
# as a web page from your browser.
# When you upload a file that already exists, it is
# renamed automatically.
# From Pythonista's settings, you can add this script
# to the actions menu of the editor for quick access.
@cornernote
cornernote / init.lua
Created October 2, 2012 01:48
Override Registered Nodes for Minetest
-- The reason this is needed is because the following code does not work as expected:
local node = minetest.registered_nodes["default:sapling"]
node.after_place_node = function(pos) print("TESTING123") end
minetest.register_node(":default:sapling", node)
--
-- inline solution
--
local node = {}
WM_KEYDOWN = 0x100
GoSub, GetHTML
OnMessage(WM_KEYDOWN, "WM_KeyDown")
Gui Add, ActiveX, w350 h300 x0 y0 vdoc, HTMLFile
doc.write(html)
Gui, Show, w310 h265 Center, HTML Based GUI
doc.all.type.focus
ComObjConnect(doc, "Doc_")
return
@fincs
fincs / main.cpp
Created May 19, 2012 22:37
Fully native C++ WinRT (Metro-style) app
//
// Fully native C++ WinRT application example
// Programmed by fincs
//
#include <windows.h>
#include <roapi.h>
#include <wchar.h>
#include <stdio.h>
#include <stdlib.h>
@nimdahk
nimdahk / HotkeySet.ahk
Created April 10, 2012 00:26
HotkeySet() in AutoHotkey for use by AU3 to AHK_L converters
HotkeySet(Hotkey, FunctionName=""){
Global HotkeySet := Object()
if !FunctionName
{
Try Hotkey, %Hotkey%, Off
return 1 ; Not specified in docs, and hell if I'm installing AU3
}
Try Hotkey, %Hotkey%, HotkeySet, On
@maul-esel
maul-esel / AHKv2 Polygon.ahk
Created February 20, 2012 12:30
Polygon - calculate the coordinates of a polygon
/*
Function: Polygon
calculates the coordinates for a polygon
Parameters:
count - the number of corners the polygon should have
radius - the radius of the polygon
[opt, byRef] x - receives an array of the x-coordinates. Omit this if not needed.
[opt, byRef] y - receives an array of the y-coordinates. Omit this if not needed.
[opt] xoffset - an optional x-offset to add to the coordinates
@louisstow
louisstow / SAT.js
Created February 2, 2011 04:46
SAT collision detection in JS
SAT: function(poly1, poly2) {
var points1 = poly1.points,
points2 = poly2.points,
i = 0, l = points1.length,
j, k = points2.length,
normal = {x: 0, y: 0},
length,
min1, min2,
max1, max2,
interval,