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 ExtractThumb($in, $out) { | |
$thumb_stdout; | |
$errors; | |
$retval = 0; | |
// Delete the file if it already exists | |
if (file_exists($out)) { unlink($out); } | |
// Use ffmpeg to generate a thumbnail from the movie | |
$cmd = "ffmpeg -i $in -ss 00:00:01 -f image2 -vframes 1 -s 300x200 $out"; | |
exec($cmd, $thumb_stdout, $retval); | |
// Queue up the error for processing |
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 getGreetingTime (m) { | |
var g = null; //return g | |
if(!m || !m.isValid()) { return; } //if we can't find a valid or filled moment, we return. | |
var split_afternoon = 12 //24hr time to split the afternoon | |
var split_evening = 17 //24hr time to split the evening | |
var currentHour = parseFloat(m.format("HH")); | |
if(currentHour >= split_afternoon && currentHour <= split_evening) { |
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/python | |
# import modules used here | |
import zipfile | |
import os | |
import shutil | |
import sys | |
import subprocess | |
import datetime | |
import pysftp as sftp |
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 DS from "ember-data"; | |
var attribute = DS.attr; | |
export default DS.Model.extend({ | |
name: attribute({ | |
first: attribute('string'), | |
last: attribute('string') | |
}), | |
time_stamp: attribute('string', { |
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 Ember from 'ember'; | |
import windowBinderMixin from '../mixins/window-binder'; | |
export default Ember.View.extend(windowBinderMixin, { | |
templateName: 'scroll-spy', | |
classNames: [ 'scroll-spy-view', 'affix' ], | |
// Bind the window events on view insertion | |
didInsertElement: function () { | |
this.setupWindowBindings(); |
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 Ember from 'ember'; | |
// This mixin binds callbacks to events. | |
export default Ember.Mixin.create({ | |
/* | |
Mixin setup | |
NOTE: Must be implemented on init, didTransition, or didInsertElement hooks | |
*/ | |
setupWindowBindings: function () { |
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
export default { | |
name: 'session', | |
after: 'store', | |
initialize: function (container, app) { | |
app.deferReadiness(); | |
var store = container.lookup('store:main'); | |
store.find('session', { active: true }).then(function (ses) { | |
container.lookup('controller:session').set('content', ses); | |
container.typeInjection('controller', 'session', 'controller:session'); |
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 Ember from 'ember'; | |
/* | |
App Initialized Session Controller | |
*/ | |
export default Ember.Controller.extend({ | |
logout: function () { | |
// Find the session | |
var ses = this.store.find('session', this.get('content').get('id')); |
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
/* | |
Quick and dirty JSON to HTML table parser | |
--- | |
Designed for use debugging in node.js | |
*/ | |
function jsonToHtml ( json, limit ) { | |
var data = json, | |
dataKeys = []; |
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
export default Ember.View.extend({ | |
didInsertElement: function () { | |
this.$().on('scroll', { emEl: this }, this._updatePosition); | |
}, | |
_updatePosition: function ( ev ) { | |
Ember.run.throttle(ev.data.emEl, function () { | |
this.set('scrollY', ev.currentTarget.scrollY); | |
}, 250); | |
} |
OlderNewer