A Pen by Andrey Dresvyannikov on CodePen.
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(val) { | |
var units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'], | |
ind = 0; | |
while (val >= 1024 && ind < units.length -1) { | |
val = val / 1024; | |
ind++; | |
} | |
return val.toFixed(3) + ' ' + units[ind]; | |
} |
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
<!doctype html> | |
<html> | |
<head> | |
<title>canv1</title> | |
</head> | |
<body> | |
<canvas id='panel'></canvas> | |
<script type="text/javascript"> | |
var PANEL = { | |
currentWidth: 800, |
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
-- Main.elm | |
update : Msg -> Model -> Model | |
update msg model = | |
case msg of | |
QuestionMsg qMsg -> | |
{ model | |
| questions = Question.update qMsg model.questions | |
} | |
ProceedToNextQuestion msg -> |
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
#!/usr/bin/env groovy | |
pipeline { | |
agent any | |
environment { | |
NODE_ENV_PATH = './venv' | |
NODE_VERSION = '6.11.1' | |
} | |
stages { | |
stage('Pre-cleanup') { | |
steps { |
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 time | |
import subprocess | |
def install_bower_deps(): | |
""" Installs bower dependencies. """ | |
subprocess.run(['echo', '--- bower install ---']) | |
time.sleep(5) # subprocess.run(['bower', 'install']) | |
subprocess.run(['echo', '--- /bower install ---']) |
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 time | |
import asyncio | |
import subprocess | |
async def install_bower_deps(): | |
""" Installs bower dependencies. """ | |
subprocess.run(['echo', '--- bower install ---']) | |
await asyncio.sleep(5) # subprocess.run(['bower', 'install']) | |
subprocess.run(['echo', '--- /bower install ---']) |
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 time | |
import asyncio | |
import subprocess | |
async def install_bower_deps(): | |
""" Installs bower dependencies. """ | |
subprocess.run(['echo', '--- bower install ---']) | |
await asyncio.sleep(5) # subprocess.run(['bower', 'install']) | |
subprocess.run(['echo', '--- /bower install ---']) |
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 typing | |
def divide(num: float, den: float) -> typing.Optional[float]: | |
return num / den | |
print(divide(1, 2)) | |
print(divide(1, 0)) |