Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma
You can get the list of supported formats with:
ffmpeg -formats
You can get the list of installed codecs with:
http://stackoverflow.com/questions/24296212/php-nodejs-and-sessions#24303059 | |
You can use memcached as your session storage handler in PHP. Memcached is a simple key value store that can be accessed via TCP; there is a memcached module available for Node.js. | |
PHP stores the session in memcached by using the session id as the key. The session data (value) stored in memcached is a serialized PHP object, with a slight twist. You can read more about this unusual serialization at the SO question "Parse PHP Session in Javascript". Luckily though, there is already an NPM module out there: php-unserialize. | |
Now for the How-To. | |
Assumptions |
The MIT License (MIT) | |
Copyright (c) 2015 Justin Perry | |
Permission is hereby granted, free of charge, to any person obtaining a copy of | |
this software and associated documentation files (the "Software"), to deal in | |
the Software without restriction, including without limitation the rights to | |
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
the Software, and to permit persons to whom the Software is furnished to do so, | |
subject to the following conditions: |
#!/bin/bash | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit | |
fi | |
apt-get install pkg-config libmagickwand-dev -y | |
cd /tmp | |
wget https://pecl.php.net/get/imagick-3.4.0.tgz | |
tar xvzf imagick-3.4.0.tgz |
var gulp = require('gulp'); | |
var babel = require("gulp-babel"); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var concat = require('gulp-concat'); | |
var uglify = require('gulp-uglify'); | |
gulp.task('default', () => { | |
return gulp.src('js/main.js') | |
.pipe(sourcemaps.init()) | |
.pipe(babel({ |
(function($) { | |
var result = $('#result'); | |
var base = $('#base'); | |
var list = $('#list'); | |
$('#calc').click(function() { | |
var baseVal = base.val(); | |
var px = list.val().split(','); | |
var html = []; | |
$.each(px, function(i, v) { | |
var px = parseInt(v); |
# best practice: linux | |
nano ~/.pgpass | |
*:5432:*:username:password | |
chmod 0600 ~/.pgpass | |
# best practice: windows | |
edit %APPDATA%\postgresql\pgpass.conf | |
*:5432:*:username:password | |
# linux |
const redisClient = redis.createClient(REDIS_URL); | |
const listeners = Object.create(null); | |
function addListener(channel, listener) { | |
if (!listeners[channel]) { | |
listeners[channel] = []; | |
redisClient.subscribe(channel); | |
} | |
listeners[channel].push(listener); |
// To run this code yourself: | |
// 1. Download and run the demo server: https://github.com/apollostack/frontpage-server | |
// 2. Use create-react-app to create a build system | |
// 3. npm install subscriptions-transport-ws | |
// 4. Replace all of the code in src/ with just this file | |
import { Client } from 'subscriptions-transport-ws'; | |
const client = new Client('ws://localhost:8090'); |