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
let imageBuffer = Buffer.from(body.profilePicture.split(',')[1], 'base64'); | |
console.log(imageBuffer); | |
Jimp.read(imageBuffer, function(err, image) { | |
if (err) { | |
context.done(err, | |
prepareErrorResponse(response, 'Unable to remove EXIF data from profile picture')); | |
} | |
console.log('before transform: ', image); | |
image = image.resize(400, 400).exifRotate((err, exifRotatedData) => { |
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
# ------------------------------------ | |
# Docker alias and function | |
# ------------------------------------ | |
# Clear all container and images | |
alias dkc-clear='docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q) && docker rmi $(docker images -q)' | |
# Stop and Remove all containers | |
alias dkc-all='docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)' |
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 * as ng from '@angular/core'; | |
import {PusherService} from '../../services/pusher.service' | |
@ng.Component({ | |
selector: 'home', | |
template: require('./home.html') | |
}) | |
export class Home { | |
constructor(private pusher: PusherService) { | |
console.log('Home:constructor'); |
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
/** | |
* @Author: bachvtuan@gmail.com | |
* to_number: String : user phone number | |
* message: String : sms message | |
* func_callback: function : callback function( status ) | |
* Reference links : | |
* https://gist.github.com/stuartmyles/8099723 | |
* http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SNS.html#deleteTopic-property | |
*/ |
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 ffmpeg = require('ffmpeg'); | |
try { | |
var process = new ffmpeg('example.mp4'); | |
process.then(function (video) { | |
console.log('The video is ready to be processed'); | |
var watermarkPath = 'watermark-suissa.png', | |
newFilepath = './video-com-watermark.mp4', | |
settings = { | |
position : "SE" // Position: NE NC NW SE SC SW C CE CW |