Skip to content

Instantly share code, notes, and snippets.

View kkinder's full-sized avatar

Ken Kinder kkinder

View GitHub Profile
@kkinder
kkinder / Quasar.xml
Created February 6, 2020 20:23
Quasar Live Templates for Jetbrains IDEs
<templateSet group="Quasar">
<template name="q-ajax-bar" value="&lt;q-ajax-bar&#10; ref=&quot;$ref$&quot;&#10; position=&quot;$position$&quot;&#10; color=&quot;$color$&quot;&#10; size=&quot;$size$&quot;&#10; skip-hijack/&gt;&#10;" description="Ajax Bar" toReformat="true" toShortenFQNames="true">
<variable name="ref" expression="" defaultValue="&quot;bar&quot;" alwaysStopAt="true" />
<variable name="position" expression="" defaultValue="&quot;bottom&quot;" alwaysStopAt="true" />
<variable name="color" expression="" defaultValue="&quot;accent&quot;" alwaysStopAt="true" />
<variable name="size" expression="" defaultValue="&quot;10px&quot;" alwaysStopAt="true" />
<context>
<option name="VUE_TEMPLATE" value="true" />
</context>
</template>
@kkinder
kkinder / Solarized Light Mixed.icls
Created April 19, 2018 18:30
JetBrains color scheme - Solarized Light with dark terminals/consoles
<scheme name="Solarized Light Mixed" version="142" parent_scheme="Default">
<option name="FONT_SCALE" value="1.0" />
<metaInfo>
<property name="created">2018-04-19T13:27:04</property>
<property name="ide">Python</property>
<property name="ideVersion">2018.1.1.0.0</property>
<property name="modified">2018-04-19T13:27:07</property>
<property name="originalScheme">Solarized Light Mixed</property>
</metaInfo>
<option name="CONSOLE_FONT_NAME" value="Source Code Pro" />
@kkinder
kkinder / pretty size
Created October 3, 2013 18:17
Show the user a friendly size. Adapted with larger sizes from http://stackoverflow.com/a/1094933
def friendly_size(length):
"""
Returns *binary* human-friendly size. Goes all the way up to YB.
>>> friendly_size(0)
'0 bytes'
>>> friendly_size(1024)
'1.0 KB'
>>> friendly_size(1524)
'1.5 KB'