More details here: https://developer.mozilla.org/en/docs/Simple_Firefox_build
Get Firefox' source code:
git clone https://github.com/mozilla/gecko-dev.git
git checkout fx-team
Install dependencies:
function countCSSRules() { | |
var results = '', | |
log = ''; | |
if (!document.styleSheets) { | |
return; | |
} | |
for (var i = 0; i < document.styleSheets.length; i++) { | |
countSheet(document.styleSheets[i]); | |
} | |
function countSheet(sheet) { |
/*! Prefix flex for IE10 and Safari / iOS in LESS | |
* https://gist.github.com/codler/2148ba4ff096a19f08ea | |
* Copyright (c) 2014 Han Lin Yap http://yap.nu; MIT license */ | |
.display(@value) when (@value = flex) { | |
display: -ms-flexbox; // IE10 | |
display: -webkit-flex; // Safari / iOS | |
} | |
.display(@value) when (@value = inline-flex) { |
More details here: https://developer.mozilla.org/en/docs/Simple_Firefox_build
Get Firefox' source code:
git clone https://github.com/mozilla/gecko-dev.git
git checkout fx-team
Install dependencies:
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
"SharePoint ID","SharePoint Description","Windows Display Name","Windows ID","IANA Time Zone" | |
"2","(UTC) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London","(UTC) Dublin, Edinburgh, Lisbon, London","GMT Standard Time","Europe/London" | |
"3","(UTC+01:00) Brussels, Copenhagen, Madrid, Paris","(UTC+01:00) Brussels, Copenhagen, Madrid, Paris","Romance Standard Time","Europe/Paris" | |
"4","(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna","(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna","W. Europe Standard Time","Europe/Berlin" | |
"5","(UTC+02:00) Athens, Bucharest, Istanbul","(UTC+02:00) Athens, Bucharest","GTB Standard Time","Europe/Bucharest" | |
"6","(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague","(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague","Central Europe Standard Time","Europe/Budapest" | |
"7","(UTC+02:00) Minsk","(UTC+03:00) Kaliningrad, Minsk","Kaliningrad Standard Time","Europe/Kaliningrad" | |
"8","(UTC-03:00) Brasilia","(UTC-03:00) Brasilia","E. South Ameri |
$.fn.wordify = function(){ | |
this.find(":not(iframe,textarea)").addBack().contents().filter(function() { | |
return this.nodeType === 3; | |
}).each(function() { | |
var textnode = $(this); | |
var text = textnode.text(); | |
text = text.replace(/([^\s-.,;:!?()[\]{}<>"]+)/g,'<span>$1</span>'); | |
textnode.replaceWith(text); | |
}); | |
return this; |
jQuery.fn.brightness = function() { | |
var bg_color, rgba, y; | |
bg_color = this.css('background-color'); | |
if ((bg_color != null) && bg_color.length) { | |
rgba = bg_color.match(/^rgb(?:a)?\(([0-9]{1,3}),\s([0-9]{1,3}),\s([0-9]{1,3})(?:,\s)?([0-9]{1,3})?\)$/); | |
if (rgba != null) { | |
if (rgba[4] === '0') { | |
if (this.parent().length) return this.parent().brightness(); | |
} else { | |
y = 2.99 * rgba[1] + 5.87 * rgba[2] + 1.14 * rgba[3]; |
<!-- | |
CHECK IF A STRING IS NULL OR EMPTY | |
--> | |
<!-- Example XML --> | |
<group> | |
<item> | |
<id>item 1</id> | |
<CategoryName>blue</CategoryName> | |
</item> |
Below is a collection of my favourite responses I gathered from Guardian engineers when asked the question: What have you learnt starting from scratch and building a mobile-first next generation web platform for the Guardian?
Every time I start a new project, I want to pull in a log
function that allows the same functionality as the console.log
, including the full functionality of the Console API.
There are a lot of ways to do this, but many are lacking. A common problem with wrapper functions is that the line number that shows up next to the log is the line number of the log function itself, not where log
was invoked. There are also times where the arguments get logged in a way that isn't quite the same as the native function.
This is an attempt to once and for all document the function that I pull in to new projects. There are two different options: