Skip to content

Instantly share code, notes, and snippets.

@chancyk
chancyk / to_excel_date.py
Last active June 1, 2017 17:34
Convert an ISO8601 date to the Excel date representation.
from datetime import datetime, date
from dateutil.parser import parse
class ExcelDateException(Exception):
pass
def to_excel_date(iso_date):
"""Convert a date to the Excel representation of a date
@chancyk
chancyk / multiple_series_varying_data.elm
Created June 13, 2017 15:41
Plot multiple series with different data.
import Svg exposing (Svg, linearGradient, stop)
import Svg.Attributes exposing (id, stroke, offset, stopColor, stopOpacity)
import Plot exposing (..)
type alias MyData =
{ areaData : List ( Float, Float )
, lineData : List ( Float, Float )
}
@chancyk
chancyk / glob.pony
Last active August 12, 2017 01:27
ponylang: Glob
use "time"
use "files"
use "glob"
actor Main
new create(env: Env) =>
let caps = recover val FileCaps.>set(FileRead).>set(FileStat).>set(FileLookup) end
use "files"
use "collections"
class RecordType1
let spec_record_type: (U32, U32) = (0, 1)
var record_type: U8 = 0
new create(line: String val) =>
try
let color = uint8((x / uiState.windowWidth) * 256)
let screen = newImage(512, 512)
let screenCtx = newContext(screen)
screenCtx.font = uiCtx.consoleFont
screen.fill(rgba(255, 255, 255, 255))
screen.fillText(
uiCtx.consoleFont.style(36, rgba(color, color, color, 255)),
$frameRate
)
var surface = createRGBSurface(0, cint 512, cint 512, 32, rmask, gmask, bmask, amask)
/* Generated by Nim Compiler v1.7.3 */
#define NIM_INTBITS 64
#define NIM_EmulateOverflowChecks
#include "nimbase.h"
#include <stdio.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC