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
const ffmpeg = require('fluent-ffmpeg'); | |
const c = new ffmpeg('video1.mp4') | |
.addInput('video2.mp4') | |
.on('error', function(err) { | |
console.log('an error happened: ' + err.message); | |
}) | |
.on('end', function() { | |
console.log('final video saved'); | |
}) |
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 the RPi.GPIO and OS | |
import RPi.GPIO as GPIO | |
import os | |
import sys | |
import time | |
# GPIO port setup | |
GPIO.setmode(GPIO.BCM) | |
# Power switch: will send a shutdown message to the OS |
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
/* http://github.com/mindmup/bootstrap-wysiwyg */ | |
/*global jQuery, $, FileReader*/ | |
/*jslint browser:true*/ | |
(function ($) { | |
'use strict'; | |
var readFileIntoDataUrl = function (fileInfo) { | |
var loader = $.Deferred(), | |
fReader = new FileReader(); | |
fReader.onload = function (e) { | |
loader.resolve(e.target.result); |
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
FROM resin/%%RESIN_MACHINE_NAME%%-node:6.9.1 | |
RUN apt-get update \ | |
&& apt-get install -y \ | |
chromium-browser \ | |
fbset \ | |
htop \ | |
libnss3 \ | |
libraspberrypi-bin \ | |
lsb-release\ |
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 node | |
'use strict'; | |
const chalk = require('chalk'); | |
const del = require('del'); | |
const fs = require('fs'); | |
const google = require('googleapis'); | |
const googleAuth = require('google-auth-library'); | |
const _ = require('lodash'); |
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
var url = [ | |
'https://api.spark.io/v1/devices/', | |
'2d0056001551353531343431', | |
'/message' | |
].join(''); | |
var postParams = [ | |
'access_token=', | |
process.env.SPARK_CORE_TOKEN, | |
'¶ms=', |
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
require 'spec_helper' | |
describe User do | |
it 'should reach out to passport via oauth and populate user attributes' do | |
user = FactoryGirl.create( | |
:user, | |
:passport_id => 2322 | |
) | |
user.email.should eq 'jlongstreet@vml.com' |
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
require 'oauth' | |
class User < ActiveRecord::Base | |
validates :email, :email => true | |
validates :name, :passport_id, :presence => true | |
before_validation :get_passport_data, :on => :create | |
def get_passport_data | |
@consumer = OAuth::Consumer.new ENV['PASSPORT_OAUTH_KEY'], |
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
require 'oauth' | |
require 'json' | |
consumer = OAuth::Consumer.new ENV['PASSPORT_OAUTH_KEY'], | |
ENV['PASSPORT_OAUTH_SECRET'], | |
{ :site => 'https://passport.vml.com' } | |
request_token = consumer.get_request_token | |
access_token = request_token.get_access_token | |
response_body = JSON.parse(access_token.get("/api/user/jlongstreet/ui.json").body) |
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
var OAuth = require('oauth').OAuth; | |
var baseURL = 'https://passport.vml.com'; | |
consumer = new OAuth( | |
baseURL + '/oauth/request_token', | |
baseURL + '/oauth/access_token', | |
process.env.PASSPORT_OAUTH_KEY, | |
process.env.PASSPORT_OAUTH_SECRET, | |
'1.0', null, 'HMAC-SHA1' | |
); |
NewerOlder