Skip to content

Instantly share code, notes, and snippets.

View kmturley's full-sized avatar

Kim T kmturley

View GitHub Profile
@kmturley
kmturley / data-functions.js
Created May 12, 2015 20:46
Re-written date functions to not use eval()
/*
* Copyright (C) 2004 Baron Schwartz <baron at sequent dot org>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, version 2.1.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
@kmturley
kmturley / VideoEditor.java
Created November 10, 2015 16:41
Extending video editor plugin functionality
package org.apache.cordova.videoeditor;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.net.URLDecoder;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@kmturley
kmturley / VideoEditor.js
Created November 10, 2015 16:45
Extending video editor functionality
//
// VideoEditor.js
//
// Created by Josh Bavari on 01-14-2014
// Modified by Ross Martin on 01-29-15
//
var exec = require('cordova/exec'),
pluginName = 'VideoEditor';
/* ng-ScrollSpy.js v3.2.1
* https://github.com/patrickmarabeas/ng-ScrollSpy.js
*
* Copyright 2014, Patrick Marabeas http://marabeas.io
* Released under the MIT license
* http://opensource.org/licenses/mit-license.php
*
* Date: 31/01/2015
*/
@kmturley
kmturley / FfmpegController.java
Created November 10, 2015 16:42
Extending video editor functionality
package org.ffmpeg.android;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
[{
"origin": "http://example.com",
"effective_connection_type": {
"name": "4G"
},
"form_factor": {
"name": "desktop"
},
"first_paint": {
"histogram": {
@kmturley
kmturley / app.component.html
Created May 21, 2018 21:32
Angular 6 + Firebase Reactive Forms
<form [formGroup]="form">
<input class="input" type="text" formControlName="title" (change)="save()" /><br/>
<input class="input" type="text" formControlName="content" (change)="save()" />
</form>
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
#!/usr/bin/env bash
# Usage:
# bash stats.sh ./directory
# bash stats.sh ./directory > stats.log
(
# Find number of children
find $1 -maxdepth 1 -type d -print0 | while read -d '' -r dir; do num=$(find $dir -ls | wc -l); printf "%5d %s\n" "$num" "$dir"; done