Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8" ?>
<billing-log>
<log-start-date>2018-01-15T10:00:00-00:00</log-start-date>
<player-name>some-player</player-name>
<schema-version>1</schema-version>
<player-uuid>2b51f999-a4d3-30dc-a357-f0ee60c34b79</player-uuid>
<log-end-date>2018-01-15T10:59:59.999-00:00</log-end-date>
<entry><in>2018-01-15T09:59:53.457-00:00</in><out>2018-01-15T10:00:04.486-00:00</out><duration>11.029</duration><channel>xx</channel><frame>Main</frame><mediaitem-path>some_media_item.mp4</mediaitem-path></entry>
<entry><in>2018-01-15T10:59:42.290-00:00</in><out>2018-01-15T10:59:53.419-00:00</out><duration>11.123</duration><channel>xx</channel><frame>Main</frame><mediaitem-path>some_media_item.mp4</mediaitem-path></entry>
</billing-log>
(defn parse-second
""
[time-string]
(str (time/second (time-coerce/from-string time-string))))
(defn parse-minute
""
[time-string]
(str (time/minute (time-coerce/from-string time-string))))
#!/usr/bin/env sh
# Stored at: https://gist.github.com/4452136
# Assumes the given path points to a FLV file with MP4 video.
# Use ffmpeg to repackage the file.
ffmpeg -i "$1" -acodec copy -vcodec copy "$1".mp4
# old version:
# Not used anymore as VLC seems to have a bug that creates broken
@crankyadmin
crankyadmin / example.cljs
Created October 28, 2016 09:29 — forked from olivergeorge/example.cljs
reframe-vs-react-virtualized
(ns example.virtualized
(:require cljsjs.react-virtualized
cljsjs.react
[cljs.spec :as s]
[re-frame.core :as re-frame]))
(def ArrowKeyStepper* (js/React.createFactory js/ReactVirtualized.ArrowKeyStepper))
(def AutoSizer* (js/React.createFactory js/ReactVirtualized.AutoSizer))
(def Collection* (js/React.createFactory js/ReactVirtualized.Collection))
@crankyadmin
crankyadmin / core.cljs
Created August 16, 2016 12:04 — forked from ducky427/core.cljs
Facebook's fixed data for reagent. Adapted from https://github.com/ul/fixed-data-table-demo
(ns datatable.core
(:require [reagent.core :as reagent]
[cljsjs.fixed-data-table]))
(def Table (reagent/adapt-react-class js/FixedDataTable.Table))
(def Column (reagent/adapt-react-class js/FixedDataTable.Column))
(defn gen-table
"Generate `size` rows vector of 4 columns vectors to mock up the table."
[size]
@crankyadmin
crankyadmin / actions.cljs
Created August 16, 2016 07:54 — forked from stephendeyoung/actions.cljs
ClojureScript function to show a Bootstrap dropdown.
(defn actions [array-of-funcs]
(doseq [func array-of-funcs] (func)))
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0" processorArchitecture="*"
/*
Document: app.js
Author: Rustheme
Description: UI Framework Custom Functionality (available to all pages)
*/
var App = function() {
/**
* CORE UI FUNCTIONALITY

Flask + uWSGI + nginx Primer

I've been having trouble with serving a Flask app via uWSGI and nginx, so I thought I'd put together some of the basics to help out others.

How this shit works

  • Flask is managed by uWSGI.
  • uWSGI talks to nginx.
def my_func():
return "embedding?"