Skip to content

Instantly share code, notes, and snippets.

View Gekkio's full-sized avatar

Joonas Javanainen Gekkio

View GitHub Profile
@Gekkio
Gekkio / test.html
Created March 25, 2011 13:46
Don't use width: 100% on block-level elements unless you know exactly what you're doing!
<html>
<body>
<div style="background-color: red; margin: 20px; width: 100%">
Fail (margin: 20px; width: 100%)
</div>
<div style="background-color: red; margin: 20px">
Success (margin: 20px)
</div>
<div style="background-color: red; padding: 20px; width: 100%">
<div style="background-color: green">
@Gekkio
Gekkio / OptionSerializers.scala
Created September 6, 2011 11:03
Kryo serializers for Scala None/Some
import com.esotericsoftware.Kryo
import com.estoericsoftware.serialize.SimpleSerializer
import java.nio.ByteBuffer
object OptionSerializers {
def register(kryo: Kryo) {
kryo.register(classOf[None$], new NoneSerializer)
kryo.register(classOf[Some[_]], new SomeSerializer(kryo))
}
}

Keybase proof

I hereby claim:

  • I am gekkio on github.
  • I am gekkio (https://keybase.io/gekkio) on keybase.
  • I have a public key whose fingerprint is 9A34 A627 EF71 5925 FE41 84AB D39C CA5C B19B 9179

To claim this, I am signing this object:

#!/usr/bin/env bash
# Based on:
# http://en.librehat.com/blog/build-gcc-5-dot-2-on-rhel-6/
set -euo pipefail
GCC_VERSION=5.3.0
GMP_VERSION=6.1.0
MPC_VERSION=1.0.3
MPFR_VERSION=3.1.4
JOBS=$(expr $(nproc) + $(nproc))
(function() {
var result = [];
function visitElement(el, parentStyle) {
var style = window.getComputedStyle(el);
if (parentStyle.display === '-ms-flexbox' && style.display === 'inline') {
result.push(el);
}
for (var i = 0; i < el.children.length; i++) {
visitElement(el.children[i], style);
}
@Gekkio
Gekkio / main.ts
Created July 18, 2016 17:42
Typescript issue #9785
import * as path from 'path';
console.info(path.delimiter);
[ignore]
[include]
[libs]
[options]
import * as React from 'react'
import * as ReactDOM from 'react-dom'
ReactDOM.render(null, null)
curl -sSL https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '("# syncToken: " + .syncToken), ("# createDate: " + .createDate), (.prefixes | .[] | select(.service == "CLOUDFRONT") | "set_real_ip_from " + .ip_prefix + ";")'
(function() {
var result = [];
function isProblematic(style) {
if (style.overflow !== 'visible') {
if (style.borderTopLeftRadius !== '0px' || style.borderTopRightRadius !== '0px') {
return true;
}
if (style.borderBottomLeftRadius !== '0px' || style.borderBottomRightRadius !== '0px') {
return true;
}