Skip to content

Instantly share code, notes, and snippets.

View nathanchere's full-sized avatar
💭
I've moved to https://gitlab.com/nathanchere - these repos no longer maintained

Nathan Chere nathanchere

💭
I've moved to https://gitlab.com/nathanchere - these repos no longer maintained
View GitHub Profile
@nathanchere
nathanchere / webstoemp-gulpfile.js
Created January 24, 2019 16:18 — forked from jeromecoupe/webstoemp-gulpfile.js
Gulp 4 sample gulpfile.js
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@nathanchere
nathanchere / mp3_info.ex
Created May 10, 2016 12:23 — forked from kommen/mp3_info.ex
Compute MP3 variable bitrate file duration with Elixir
defmodule Mp3Info do
def duration(data) do
compute_duration(data, 0, 0)
end
defp compute_duration(data, offset, duration) when byte_size(data) > offset do
case decode_header_at_offset(offset, data) do
{:ok, length, {samplerate, samples}} ->
compute_duration(data, offset + length, duration + (samples / samplerate))
@nathanchere
nathanchere / greedy.c
Last active August 29, 2015 14:26 — forked from JamesCalleja/greedy.c
#include <stdio.h>
#include <float.h>
// declare global variables
float qrt;
float dim;
float nik;
float pen;
float chg;