C++

  LOG(INFO) << "\x1b[33m" << "C" << "\x1b[0m";
  
  cout << "\x1b[33m" << "C" << "\x1b[0m" << endl;

Javascript

Loop shorthand for array access
  for (var i = 0, item; item = xpr.item(i); ++i) {
    push(item);
  }
Logging convenience with closures
  var logger = {
    msgKeys: {},
    msgCounts: {},

    logOnce: function(key, msg) {
      if (!this.msgKeys[key]) {
        console.log(msg);
        this.msgKeys[key] = true;
      }
    },

    logEveryN: function(n, key, msg) {
      if (!this.msgCounts[key]) {
        this.msgCounts[key] = 1;
      }
      if (this.msgCounts[key] % n == 0) {
        console.log(msg);
      } 
      this.msgCounts[key] += 1;
    },
  };
Find position
  var findPos = function(obj) {
    var curleft = curtop = 0;
    if (obj.offsetParent) {
      do {
        curleft += obj.offsetLeft;
        curtop += obj.offsetTop;
      } while (obj = obj.offsetParent);
    }
    return [curleft, curtop];
  };
Closure
  var RandomNumberGen = function(seed) {
    var seed_ = seed;
    return {
      getRandomNum: function() {
        return Math.random();
      },
    };
  };

Python