This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$.fn.textfill = function(maxFontSize) { | |
maxFontSize = parseInt(maxFontSize, 10); | |
return this.each(function(){ | |
var ourText = $("span", this), | |
parent = ourText.parent(), | |
maxHeight = parent.height(), | |
maxWidth = parent.width(), | |
fontSize = parseInt(ourText.css("fontSize"), 10), | |
multiplier = maxWidth/ourText.width(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
::-webkit-scrollbar | |
width: 10px | |
height: 10px | |
::-webkit-scrollbar-thumb | |
background-color: rgba(50,50,50,.25) | |
border: 2px solid transparent | |
border-radius: 10px | |
background-clip: padding-box |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Replace outline with box-shadow | |
// because it was wrapping around after psudo element border | |
outline: 0 | |
// white rectangle inside grey rectangle | |
// 2px offset down to center | |
// 1px blur | |
box-shadow: 0 2px 1px 3px white, 0 2px 1px 6px rgba(119, 119, 119, 0.4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws_security_group.worker | |
2015/05/28 11:48:42 [TRACE] Graph after step *terraform.RootTransformer: | |
aws_security_group.worker | |
2015/05/28 11:48:42 [DEBUG] vertex root.mymodule.aws_security_group.worker: walking | |
* DependencyViolation: resource sg-api has a dependent object | |
2015/05/28 11:48:42 [DEBUG] vertex root.mymodule.aws_security_group.worker: evaluating | |
2015/05/28 11:48:42 [DEBUG] root.mymodule: eval: *terraform.EvalSequence | |
2015/05/28 11:48:42 [DEBUG] root.mymodule: eval: terraform.EvalNoop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def factorial(x): | |
result = 1 | |
for i in xrange(1, x + 1): | |
result *= i | |
return result | |
###################################################################### | |
def _if(test): | |
return lambda alternative: \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from shapely.geometry.base import BaseGeometry | |
from shapely.geometry import shape, mapping | |
class ShapelyEncoder(json.JSONEncoder): | |
def default(self, obj): | |
if isinstance(obj, BaseGeometry): | |
return mapping(obj) | |
return json.JSONEncoder.default(self, obj) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import timeit | |
setup = """ | |
import random, operator | |
class Test(): | |
def __init__(self, t): | |
self.test = t | |
l = [Test(str(i)) for i in range(1000)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adjust device pixel ratio | |
setMaximumPixelRatio = (p_maximumRatio=1) -> | |
canvas = document.createElement('canvas') | |
context = canvas.getContext('2d') | |
devicePixelRatio = window.devicePixelRatio || 1 | |
backingStoreRatio = context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1 | |
pixelRatio = devicePixelRatio / backingStoreRatio | |
for className in ["HitCanvas", "SceneCanvas", "Canvas"] | |
Kinetic[className].prototype.init = ((p_method) -> (p_config={}) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parseInt(getComputedStyle($('#hours'), ':after').top)/-76*60*60 + | |
parseInt(getComputedStyle($('#seconds'), ':after').top)/-76 + | |
parseInt(getComputedStyle($('#minutes'), ':after').top)/-76*60 + | |
parseInt(getComputedStyle($('#centiseconds'), ':after').top)/-76/100 |
OlderNewer