Skip to content

Instantly share code, notes, and snippets.

<style>
[data-custom-class='body'], [data-custom-class='body'] * {
background: transparent !important;
}
[data-custom-class='title'], [data-custom-class='title'] * {
font-family: Arial !important;
font-size: 26px !important;
color: #000000 !important;
}
[data-custom-class='subtitle'], [data-custom-class='subtitle'] * {
2015-06-11T09:51:41.947316+00:00 app[web.1]: ETHON: performed EASY effective_url=https://xxx-xxx.s3.eu-central-1.amazonaws.com/1/954c457c-bb5a-498f-b1e8-7a8fd0d63ce5/e5f7bd3d-514e-4bf5-b88b-3923f1a9cdf4.jpg response_code=200 return_code=ok total_time=1.953845
2015-06-11T09:51:42.146359+00:00 app[web.1]: ETHON: performed EASY effective_url=https://xxx-xxx.s3.eu-central-1.amazonaws.com/1/954c457c-bb5a-498f-b1e8-7a8fd0d63ce5/ba66e48e-5e3e-4618-acc5-31648c650ff4.jpg response_code=200 return_code=ok total_time=1.95379
2015-06-11T09:51:42.273305+00:00 app[web.1]: ETHON: performed EASY effective_url=https://xxx-xxx.s3.eu-central-1.amazonaws.com/1/954c457c-bb5a-498f-b1e8-7a8fd0d63ce5/cdfa0ace-f09b-46b1-b490-2a13acc463ab.jpg response_code=200 return_code=ok total_time=1.956318
2015-06-11T09:51:42.570261+00:00 app[web.1]: ETHON: performed EASY effective_url=https://xxx-xxx.s3.eu-central-1.amazonaws.com/1/954c457c-bb5a-498f-b1e8-7a8fd0d63ce5/66072000-02cd-42cd-8d01-7bb3ddb3fcfb.jpg response_code=200 return_code=ok total
@jtreitz
jtreitz / gist:7fb95b24d072913d526f
Created June 26, 2014 12:46
Auto logout on inactivity (works across tabs)
$ ->
IDLE_TIMEOUT = 120
CheckIdleTime = ->
if (new Date() - Date.parse(window.localStorage.getItem('IDLE')) >= IDLE_TIMEOUT*1000)
$("#logout-button").trigger "click"
document.onkeydown = document.onmousemove = document.onclick = ->
window.localStorage.setItem('IDLE', new Date())
@jtreitz
jtreitz / gist:e17967accee3333dc698
Created June 23, 2014 12:55
Metropolitan Area Airport Codes
BJS:
name: Beijing
country: China
BKK:
name: Bangkok
country: Thailand
OSA:
name: Osaka
country: Japan
SPK:
_is_css_blur_supported = (->
_supported = 'dontknow'
return ->
return _supported unless _supported == 'dontknow'
el = $('<div/>')
$(document.body).append(el)
el[0].style.webkitFilter = "grayscale(1)"
_supported = window.getComputedStyle(el[0]).webkitFilter == "grayscale(1)"
el.remove()
return _supported
@jtreitz
jtreitz / linear_partition.coffee
Last active December 16, 2015 20:10
Linear partition in Coffeescript (Javascript)
# Linear partition
# Partitions a sequence of non-negative integers into k ranges
# Based on Óscar López implementation in Python (http://stackoverflow.com/a/7942946)
# Also see http://www8.cs.umu.se/kurser/TDBAfl/VT06/algorithms/BOOK/BOOK2/NODE45.HTM
# Dependencies: UnderscoreJS (http://www.underscorejs.org)
# Example: linear_partition([9,2,6,3,8,5,8,1,7,3,4], 3) => [[9,2,6,3],[8,5,8],[1,7,3,4]]
linear_partition = (seq, k) =>
n = seq.length