Skip to content

Instantly share code, notes, and snippets.

View jbaiera's full-sized avatar

James Baiera jbaiera

View GitHub Profile
@cowboy
cowboy / #bf4-emblem-import-export.md
Last active December 3, 2023 17:43
JavaScript: BF4 Battlelog Emblem Import / Export

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)+');');
  6. Paste somewhere useful, like a gist. Whatever.
  7. Close the console (Ctrl-Shift-J).
@jbenet
jbenet / simple-git-branching-model.md
Last active September 19, 2024 16:05
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@jbaiera
jbaiera / .gitconfig
Last active May 4, 2016 17:40
Git Graph - Pretty Print Log format for Git
[alias]
graph1 = log --graph --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative --color --date-order
graph2 = log --graph --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(bold white)— %an%C(reset)%n%w(70,12,10)%C(white)%s%C(reset)%n' --abbrev-commit --color --date-order
graph = !"git graph1"
@adam-davis
adam-davis / negbrush.cpp
Created April 12, 2012 23:56
A negative filter brush
void FilterBrush::mouseMoveEvent(QMouseEvent* event, PaintArea *ourImage)
{
QImage* qImage = ourImage->getImage();
int xCenter = event->pos().x(), yCenter = event->pos().y() , radius = 35;
int left = xCenter - radius;
int right = left + radius * 2;
int top = yCenter - radius;