Skip to content

Instantly share code, notes, and snippets.

Daniel Baron barooney

Block or report user

Report or block barooney

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@barooney
barooney / add-subtitles.sh
Last active Jun 19, 2018
Add subtitles to video file.
View add-subtitles.sh
#!/bin/bash
# run with ./add-subtitles.sh video.mp4 subtitles.srt output.mp4
VIDEO_FILE=$1
SUBTITLE_FILE=$2
OUTPUT_FILE=$3
echo "Muxing " $VIDEO_FILE " and " $SUBTITLE_FILE " into " $OUTPUT_FILE "..."
ffmpeg -i $VIDEO_FILE -i $SUBTITLE_FILE -c:a copy -c:v copy -c:s mov_text $OUTPUT_FILE
@barooney
barooney / ghost-import.php
Created Apr 26, 2018
Import Ghost exports to WordPress
View ghost-import.php
<?php
define( 'WP_POST_REVISIONS', false );
define( 'BASE_URL', 'YOUR_GHOST_URL' );
include './wp-load.php';
if ( ! function_exists( 'wp_crop_image' ) ) {
include( ABSPATH . 'wp-admin/includes/image.php' );
}
@barooney
barooney / download-with-cep.js
Last active Apr 13, 2018
Download a binary file with axios and store it from within a CEP panel using cep.fs
View download-with-cep.js
function downloadFile(url, filename) {
axios.get(url, { responseType: 'arraybuffer' }).then(res => {
let data = btoa(new Uint8Array(res.data).reduce((data, byte) => data + String.fromCharCode(byte), ''))
cep.fs.writeFile(filename, data, this.cep.encoding.Base64)
})
}
@barooney
barooney / composer.json
Created Jan 7, 2016
FTP to Dropbox Migration
View composer.json
{
"name": "barooney/ftp-dropbox-migrator",
"description": "Migrates a full FTP server to a Dropbox",
"type": "console",
"require": {
"league/flysystem": "^1.0",
"league/flysystem-dropbox": "^1.0"
},
"authors": [
{
@barooney
barooney / AuthController.php
Created Sep 21, 2015
Laravel Socialite and Hello.js implementation
View AuthController.php
use Schoolm8\Http\Requests;
use Illuminate\Support\Facades\Session;
use Schoolm8\Http\Controllers\Controller;
use Laravel\Socialite\Facades\Socialite;
class AuthController extends Controller {
public function proxy( Request $request ) {
if ( ! $request->oauth_token ) {
You can’t perform that action at this time.