Skip to content

Instantly share code, notes, and snippets.

View itoonx's full-sized avatar
👻
Deep

Makkhawan Voraboot itoonx

👻
Deep
View GitHub Profile
@suissa
suissa / watermark.js
Last active June 12, 2023 10:07
Add watermark with Node.js and ffmpeg
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
@bachvtuan
bachvtuan / send_sms.js
Last active April 11, 2018 10:25
Send SMS Amazon SNS Nodejs
/**
* @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
*/
@fergalmoran
fergalmoran / home.component.ts
Last active August 21, 2018 03:52
Angular 2 Pusher Service
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');
# ------------------------------------
# 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)'
@ASteinheiser
ASteinheiser / jimp-example.js
Created July 6, 2018 18:46
An example of how to use Jimp to read a base64 image string, resize, removeExif data, then return as an image buffer.
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) => {