Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View martinjlowm's full-sized avatar
🌮
HACKERMAN

Martin Jesper Low Madsen martinjlowm

🌮
HACKERMAN
View GitHub Profile
if (select(2, UnitClass("player")) ~= "PRIEST") then
return
end
local _, bindings = ...
local priestBase = {
[1] = "s|Holy Fire",
[2] = "s|Smite",
[3] = "s|Mind Blast",
function Timer:UpdateText(forceStyleUpdate)
--if there's time left on the clock, then update the timer text
--otherwise stop the timer
local remain = self.duration - (GetTime() - self.start)
if remain > 0 then
--hide text if it's too small to display
--check again in one second
if (self:GetEffectiveScale() * self.fontSize / UIParent:GetScale()) < OmniCC:GetMinFontSize() then
self.text:Hide()
self.nextUpdate = 1
@martinjlowm
martinjlowm / CombatText.lua
Created November 10, 2010 14:06
Let's the user change the position of the built in Combat Text (WoW)
local xOffset, yOffset = 300, 100
CombatText_AddMessage = function(message, scrollFunction, r, g, b, displayType, isStaggered)
local string, noStringsAvailable = CombatText_GetAvailableString()
if noStringsAvailable then
return
end
message = subString(message, msgType)
string:SetText(message)
@martinjlowm
martinjlowm / gist:1220745
Created September 15, 2011 23:07
Replace HTML paragraphs with breaks, assuming the content is in a <p>-wrapper that we want to keep.
<?php
$bodyText = $content['field_body']; // This is incorrect, the structure is different (use var_dump to figure it out)
$ptOne = substr($bodyText, 0, 3); // <p> - 0, 1, 2
$ptTwo = substr($bodyText, 3, -4); // text inside wrapper
$ptThree = substr($bodyText, -4); // </p> - 0, 1, 2, 3
$newcontent = preg_replace("/<p[^>]*?>/", "", $ptTwo);
$newcontent = str_replace("</p>", "<br /><br />", $newcontent);
---
es-PE:
'no': "No"
'yes': "Sí"
5_biggest_spenders: Los 5 compradores principales
a_copy_of_all_mail_will_be_sent_to_the_following_addresses: Una copia de todos los correos será enviada a las siguientes direcciones
abbreviation: Abreviatura
access_denied: "Acceso denegado"
account: Cuenta
account_updated: "¡Cuenta actualizada!"
@martinjlowm
martinjlowm / custom_page_editor.js.coffee
Created January 23, 2012 10:50
Altered Page Editor (Mercury)
class @Mercury.CustomPageEditor extends @Mercury.PageEditor
constructor: ->
super
save: ->
url = @saveUrl ? Mercury.saveURL ? @iframeSrc()
data = @serialize()
Mercury.log('saving', data)
data = jQuery.toJSON(data) unless @options.saveStyle == 'form'
method = Mercury.saveMethod || "POST"
@martinjlowm
martinjlowm / mercury.js
Created January 23, 2012 10:55
JQuery implementation of Mercury settings (bottom part)
$(window).bind('mercury:ready', function() {
var content = $('#mercury_iframe').contents().find('#content');
Mercury.saveMethod = content.data('save-method');
Mercury.saveURL = content.data('save-url');
});
@martinjlowm
martinjlowm / devise.da.yml
Created January 31, 2012 14:51 — forked from jgrau/devise.da.yml
Updated to accommodate devise 2.0.0 - revert personal change... Doh!
da:
errors:
messages:
expired: "er udløbet. Vær venlig at bede om en ny"
not_found: "ikke fundet"
already_confirmed: "er allerede bekræftet"
not_locked: "var ikke låst"
not_saved:
one: "1 fejl medførte at denne %{resource} ikke kunne gemmes:"
other: "%{count} fejl medførte at denne %{resource} ikke kunne gemmes:"
.shadow {
position: relative;
top: 20px;
height: 20px;
}
.shadow:before {
position: absolute;
content: '';
left: 0;
right: 0;
.shadow {
position: relative;
top: 20px;
height: 20px;
}
.shadow:before {
position: absolute;
content: '';
left: 0;
right: 0;