Skip to content

Instantly share code, notes, and snippets.

@srikarg
srikarg / pydub-combine-songs
Created March 20, 2015 23:00
This is an example of combining a folder of songs into one mp3 file using pydub (http://pydub.com/).
import os
from glob import glob
from pydub import AudioSegment
AudioSegment.converter = '/usr/local/bin/ffmpeg'
playlist_songs = [AudioSegment.from_mp3(file) for file in glob('songs/*.mp3')]
combined = AudioSegment.empty()
for song in playlist_songs:
combined += song
@srikarg
srikarg / pydub-trim-songs
Created March 20, 2015 22:58
This is an example of using pydub (http://pydub.com/) to trim a folder of songs from a given start time to end time specified in a text file.
import os
import pydub
pydub.AudioSegment.converter = '/usr/local/bin/ffmpeg'
songsDir = 'Original Songs'
trimmedDir = 'Trimmed Songs'
data = []
def trimSong(file, index):
values = data[index].split(',')
@srikarg
srikarg / boilerplate.css
Last active November 3, 2019 17:45
Boilerplate CSS.
*,
*:before,
*:after {
box-sizing: border-box;
padding: 0;
margin: 0;
}
html,
body {
@srikarg
srikarg / gulpfile.js
Last active August 29, 2015 13:59
A boilerplate gulpfile (http://gulpjs.com/). Features live reloading of SASS, CoffeeScript, and HTML.
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')();
plugins.connect = require('gulp-connect');
plugins.jshint = require('gulp-jshint');
var port = 4000;
gulp.task('styles', function() {
return plugins.rubySass('sass/main.scss', { style: 'compressed' })
.pipe(plugins.autoprefixer('last 15 version'))
@srikarg
srikarg / gulpfile.js
Created February 8, 2014 22:56
A gulpfile (http://gulpjs.com/) for Jekyll sites.
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')();
var port = 4000;
gulp.task('styles', function() {
return gulp.src('src/assets/css/**/*.css')
.pipe(plugins.concat('main.css'))
.pipe(plugins.autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
.pipe(plugins.rename({ suffix: '.min' }))
.pipe(plugins.minifyCss())