Skip to content

Instantly share code, notes, and snippets.

View AdrianoCahete's full-sized avatar
🎯
Focusing

Adriano Cahete AdrianoCahete

🎯
Focusing
View GitHub Profile
/*
* Find if a background is dark or light and define text color.
* Created by Adriano Caheté <https://github.com/AdrianoCahete>
*/
$(document).ready(function () {
function isDark(color) {
var match = /rgb\((\d+).*?(\d+).*?(\d+)\)/.exec(color);
var r = parseInt(match[1]);
var g = parseInt(match[2]);
var b = parseInt(match[3]);
@AdrianoCahete
AdrianoCahete / FiftyShades.css
Last active November 3, 2015 22:14
50 Shades of Grey in SASS
.FiftyShades > div {
width: 100%;
height: 30px;
}
.FiftyShades > div:nth-child(1) {
background-color: #818181;
}
.FiftyShades > div:nth-child(2) {

(Note: only tested in BF4 beta and Chrome on Windows)

Exporting an emblem

  1. Log into BF4 Battlelog.
  2. Visit the Customize emblem page.
  3. Select the emblem you wish to export.
  4. Open the console (Ctrl-Shift-J).
  5. Enter the following code snippet to copy the raw emblem data to the clipboard:
    copy('emblem.emblem.load('+JSON.stringify(emblem.emblem.data,null,2)+');');