This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function getcolor(unit) | |
local reaction = UnitReaction(unit, "player") or 5 | |
if UnitIsPlayer(unit) then | |
local _, class = UnitClass(unit) | |
local color = RAID_CLASS_COLORS[class] | |
return color.r, color.g, color.b | |
elseif UnitCanAttack("player", unit) then | |
if UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit) or UnitIsDead(unit) then | |
return 136/255, 136/255, 136/255 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if not TukuiCF["raidframes"].enable == true then return end | |
local raid_width = TukuiDB.Scale((TukuiActionBarBackground:GetWidth() / 5) - 7)*TukuiCF["raidframes"].scale | |
local raid_height = TukuiDB.Scale(24)*TukuiCF["raidframes"].scale | |
local function Shared(self, unit) | |
self.colors = TukuiDB.oUF_colors | |
self:RegisterForClicks("LeftButtonDown", "RightButtonDown") | |
self:SetScript('OnEnter', UnitFrame_OnEnter) | |
self:SetScript('OnLeave', UnitFrame_OnLeave) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local model = CreateFrame("PlayerModel", "CombatIndicator", UIParent) | |
model:SetScript("OnAnimFinished", function(model) model:SetModel(nil) end) | |
model:SetScript("OnEvent", function(model) model:SetModel([[spells\rake.mdx]]) end) | |
model:RegisterEvent("PLAYER_REGEN_ENABLED") | |
model:RegisterEvent("PLAYER_REGEN_DISABLED") | |
model:SetSize(500, 500) | |
model:SetFrameStrata("BACKGROUND") | |
model:SetFrameLevel(0) | |
model:SetPoint("LEFT") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local addmsg = ChatFrame1.AddMessage | |
local function hook(frame, text, ...) | |
if text:find(gsub(ERR_AUCTION_SOLD_S,'%%s', '')) then -- "A buyer has been found for your auction of %s." | |
local itemname = text:match(gsub(ERR_AUCTION_SOLD_S, '%%s', '(.+)')) | |
text = "|cffef4341"..BUTTON_LAG_AUCTIONHOUSE.."|r - |cffBCD8FF"..ITEM_SOLD_COLON.."|r " | |
local _, solditem = GetItemInfo(itemname) | |
if solditem then | |
text = text..solditem | |
else | |
text = text..itemname |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <sys/stat.h> | |
#include "zlib.h" | |
struct tarheader { // for parsing the tar headers | |
char name[100]; | |
char mode[8]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def interpolate_angle(a, b, alpha): | |
a, b = math.radians(a), math.radians(b) | |
# add up weighted unit vectors | |
vx = math.cos(a) * (1 - alpha) + math.cos(b) * alpha | |
vy = math.sin(a) * (1 - alpha) + math.sin(b) * alpha | |
# is our unit vector undefined? then return counter-clockwise increasing rotation | |
if vx == 0 and vy == 0: | |
return (math.degrees(a) + 180 * alpha) % 360 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division, print_function | |
import pyglet | |
import map | |
import function | |
class Game: | |
PHYSICS_TIMESTEP = 1/60 # how often the physics should be updated in seconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import random | |
import collections | |
def primesbelow(N): | |
# http://stackoverflow.com/questions/2068372/fastest-way-to-list-all-primes-below-n-in-python/3035188#3035188 | |
#""" Input N>=6, Returns a list of primes, 2 <= p < N """ | |
correction = N % 6 > 1 | |
N = {0:N, 1:N-1, 2:N+4, 3:N+3, 4:N+2, 5:N+1}[N%6] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC=gcc | |
CFLAGS=-O3 -Wall -std=c99 | |
LIBS=-s | |
main.exe: main.o | |
${CC} -o main.exe main.o ${LIBS} | |
main.o: main.c | |
${CC} ${CFLAGS} -c -o main.o main.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC=gcc | |
CFLAGS=-O3 -Wall -std=c99 | |
LIBS=-s | |
main.exe: main.o | |
${CC} -o main.exe main.o ${LIBS} | |
main.o: main.c | |
${CC} ${CFLAGS} -c -o main.o main.c |
OlderNewer