Skip to content

Instantly share code, notes, and snippets.

View emaxerrno's full-sized avatar
💭
I may be slow to respond.

Alexander Gallego emaxerrno

💭
I may be slow to respond.
View GitHub Profile
forceRerenderOnWebkit: ->
@el.parentNode.style.cssText += ';-webkit-transform:rotateZ(0deg)'
@el.parentNode.offsetHeight
@el.parentNode.style.cssText += ';-webkit-transform:none'
@emaxerrno
emaxerrno / gist:6732144
Created September 27, 2013 17:36
repaintjs
repaint: function() {
var self = this;
Yieldmo.foreach(self.placements, function(placement){
if (placement){
var t = document.createTextNode(' ');
placement.appendChild(t);
placement.offsetHeight; // forces repaint
setTimeout(function() { placement.removeChild(t); }, 0);
}
});
@emaxerrno
emaxerrno / gist:6771185
Created September 30, 2013 22:22
wuttt - free lunch?
instances = new ImpressionKafkaLogger[IMPRESSIONS_LOGGING_THREADS];
for (int i=0; i<instances.length;i++) {
instances[i] = new ImpressionKafkaLogger(i);
instances[i].start();
}
@emaxerrno
emaxerrno / .gitconfig
Created October 2, 2013 18:53
git-config
[user]
name = agallego
email = gallego.alexx@gmail.com
[color]
ui = auto
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
package com.yieldmo.protobuf;
option java_package = "com.yieldmo.protobuf";
option java_generate_equals_and_hash = true;
option java_outer_classname = "AdServer";
// landscaper experiment ids are not here on purpose
// these are only variables available on request
// or that are translated form a request
private static final long addressOffset;
static {
try {
addressOffset = UnsafeAccess.unsafe.objectFieldOffset(Buffer.class.getDeclaredField("address"));
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public static long getAddress(ByteBuffer buffy) {
@emaxerrno
emaxerrno / Format.scala
Created October 8, 2013 20:17
scalariformsettings
import sbt._
import Keys._
object Format {
import com.typesafe.sbt.SbtScalariform._
lazy val settings = scalariformSettings ++ Seq(
ScalariformKeys.preferences := formattingPreferences,
unmanagedSourceDirectories in (Compile,ScalariformKeys.format) <+= baseDirectory( _/"src" ),
#!/usr/bin/env python
"""A Python git pre-commit script for Go programming language projects.
Install the script by putting it in .git/hooks/ directory in your project
directory. The script file must be called "pre-commit". Make sure the
executable flag in the script file is set. The script assumes you are building
your project with make.
The script makes sure that all go source files in the project have valid
@emaxerrno
emaxerrno / ResourceUtils.java
Created October 15, 2013 21:26
load resource properly.
package com.yieldmo.common.test.utils;
import java.lang.ClassLoader;
import java.net.URL;
final public class ResourceUtils {
static public String getResourceFilename(String filename){
ClassLoader loader = ResourceUtils.class.getClassLoader();
URL resourceUrl = loader.getResource(filename);
if(resourceUrl != null &&
@emaxerrno
emaxerrno / webperf.txt
Created October 17, 2013 20:04
webperf.txt
ilya grigorik
-chrome:
techniques:
70% of time is network.
not really bound by bandwidth.
bandwidth chart. --> look at that on chrome.
look at connection view (tcp connection did we open for this page) -- lag time
minimize the RTT -->
pre-resolve
preconnect