Skip to content

Instantly share code, notes, and snippets.

Avatar
🌮
HACKERMAN

Martin Jesper Low Madsen martinjlowm

🌮
HACKERMAN
View GitHub Profile
View oBindings_Gdx priest.lua
if (select(2, UnitClass("player")) ~= "PRIEST") then
return
end
local _, bindings = ...
local priestBase = {
[1] = "s|Holy Fire",
[2] = "s|Smite",
[3] = "s|Mind Blast",
View gist:651568
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 Nov 10, 2010
Let's the user change the position of the built in Combat Text (WoW)
View CombatText.lua
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 Sep 15, 2011
Replace HTML paragraphs with breaks, assuming the content is in a <p>-wrapper that we want to keep.
View gist:1220745
<?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);
View gist:1501803
---
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 Jan 23, 2012
Altered Page Editor (Mercury)
View custom_page_editor.js.coffee
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 Jan 23, 2012
JQuery implementation of Mercury settings (bottom part)
View mercury.js
$(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 Jan 31, 2012 — forked from jgrau/devise.da.yml
Updated to accommodate devise 2.0.0 - revert personal change... Doh!
View devise.da.yml
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:"
View dabblet.css
.shadow {
position: relative;
top: 20px;
height: 20px;
}
.shadow:before {
position: absolute;
content: '';
left: 0;
right: 0;
View dabblet.css
.shadow {
position: relative;
top: 20px;
height: 20px;
}
.shadow:before {
position: absolute;
content: '';
left: 0;
right: 0;