Skip to content

Instantly share code, notes, and snippets.

@silverwind
silverwind / spacing.css
Created August 5, 2013 16:46
hack fix for line number spacing
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document regexp("^http(s)?://((www|gist|help|status).)?github.*") {
/* Github Dark Theme v1.3.5 (6/18/2013)
* https://github.com/Mottie/Github-Dark
* http://userstyles.org/styles/37035
* License: http://sam.zoy.org/wtfpl/
*/
@silverwind
silverwind / devtools.css
Last active December 18, 2015 14:29
devtools.css
@-moz-document url("chrome://browser/content/devtools/markup-view.xhtml") {
body { font-size: 15px !important; font-family: monospace !important; background: linear-gradient(#282828, #111) !important; background-attachment: fixed !important; }
.editable, .codebox { color: #ccc !important; }
.tagname { color: #f5a !important; }
.attrname { color: #5af !important; }
.attrvalue { color: #fa5 !important; }
.editable:focus { outline: none !important;}
.attreditor:hover { border-bottom: 1px dotted #ccc !important; }
.theme-selected { background: transparent !important;}
.theme-selected:after { content: ''; position: absolute; top: 0; left: -4000px; width: 8000px; height: 100%; z-index: -1; border: 1px solid #555; background: linear-gradient(#000,#111); }
@silverwind
silverwind / setClass.css
Last active December 17, 2015 18:29
Set a class once the DOM has fully loaded it
@keyframes nodeInserted {
from { clip: rect(1px, auto, auto, auto); }
to { clip: rect(0px, auto, auto, auto); }
}
body {
background: #222
}
div {
height: 200px;
width: 200px;
position:absolute;
background: #f51;
transition: left .5s ease;
body {
background: #222
}
div {
height: 200px;
width: 200px;
position:absolute;
background: #f51;
transition: left .5s ease;
double GetPvESpellHitRate(byte playerLevel, byte targetLevel, byte spellLevel, uint attackerCount)
{
double hitrate;
if ( playerlevel > targetLevel) // Player > Mob, no base miss rate, 0.5% miss per spelllevel lower than moblevel
hitrate = 1 + (spellLevel - targetLevel)/200);
else if ( targetLevel == playerlevel) // Player == Mob, 15% base miss rate, 0.5% miss per spelllevel lower than moblevel
hitrate = 0.85 + (spellLevel - targetlevel)/200);
else // Player < Mob, guessed formula
{
if ( spellLevel > targetLevel) return 1; // Just a safety check so we don't sqrt a negative number. this should never happen as a player cannot have higher spells than his level is
float GetPvESpellHitRate(byte playerLevel, byte targetLevel, byte spellLevel)
{
float hitrate;
if ( playerlevel > targetLevel) // Player > Mob, no base miss rate, 0.5% miss per spelllevel lower than moblevel
hitrate = 1 + (spellLevel - targetLevel)/200);
else if ( targetLevel == playerlevel) // Player == Mob, 15% base miss rate, 0.5% miss per spelllevel lower than moblevel
hitrate = 0.85 + (spellLevel - targetlevel)/200);
else // Player < Mob, guessed formula
hitrate = 0.85 - Math.Sqrt(targetlevel - spellLevel) * 9;