Skip to content

Instantly share code, notes, and snippets.

View sheldonbaker's full-sized avatar

Sheldon Baker sheldonbaker

View GitHub Profile
@mrbar42
mrbar42 / README.md
Last active October 25, 2024 19:35
Secured HLS setup with Nginx as media server

Secured HLS setup with Nginx as media server

This example is part of this article.

This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:

  • Domain filtering
  • Referrer filtering
  • Embed buster
@bekce
bekce / README.md
Created February 21, 2017 13:36
ldap server with mysql backend

I wanted to build an LDAP server that queries a MySQL server to fetch users and check their passwords. It is mainly used for old software that does not work with custom OAuth2 providers. Redmine is an example of this.

Instructions:

  1. Create the database and table with insert.sql
@antiboredom
antiboredom / transcribe.js
Last active November 22, 2019 01:26
Transcribe video/audio using IBM Watson
var request = require('request');
var fs = require('fs');
var sox = require('sox');
var spawn = require('child_process').spawn;
var WATSON_USER = '';
var WATSON_PASS = '';
var url = 'https://stream.watsonplatform.net/speech-to-text/api/v1/recognize';
@DenisIzmaylov
DenisIzmaylov / INSTALLATION.md
Last active November 9, 2024 13:39
DigitalOcean Dokku: fresh install with Node.js Environment

DigitalOcean Dokku / Node.js Cloud Environment

Custom recipe to get full Node.js Cloud Environment in DigitalOcean Dokku droplet running from scratch. Yes. Your own Heroku for $5 per month.

I use this gist to keep track of the important configuration steps required to have a functioning system after fresh install.

When you have executed that's all step by step you will get a new working and stable system which is ready to host & serve your Node.js application and databases.

@shuber
shuber / add_index_patch.rb
Created April 1, 2015 07:43
ActiveRecord `add_index` patch for PostgreSQL JSONB GIN indexes
# This patch detects {index_columns} that match something like
# the example below, then strips the surrounding double quotes.
#
# "(settings->'example')"
#
# The resulting CREATE INDEX sql looks something like:
#
# CREATE INDEX "idx_users_on_settings_example" ON "users" USING gin ((settings->>'example'))
#
# Your {add_index} call should looks something like:
@jasonmit
jasonmit / gist:3124ec73d76c9b380047
Created August 6, 2014 06:29
Exposing component from within the context of the yield http://jsfiddle.net/NQKvy/1233/
App = Ember.Application.create({});
var get = Ember.get, set = Ember.set, View = Ember.View;
App.FooBarComponent = Ember.Component.extend({
test: 'I am from the component!',
layout: Ember.Handlebars.compile("{{yield}}"),
_yield: function(context, options) {
var view = options.data.view,
parentView = this._parentView,
template = get(this, 'template');
@trianglegrrl
trianglegrrl / ember-cucumber.rb
Last active June 7, 2022 19:37
Testing Ember with Cucumber
# You need some sort of indication that an Ajax transaction exists. jQuery.active doesn't seem to do the
# trick, so we use the following JS (well, we use CoffeeScript, but whatever) that gets inserted into
# our application.
#
#$(function() {
# var body, doc;
# body = $('body');
# doc = $(document);
# doc.ajaxStart(function() {
# return body.addClass('ajax-in-progress').removeClass('ajax-quiet');
@machty
machty / document-title-router.js
Created January 14, 2014 05:12
document.title integration in ember
// Extend Ember.Route to add support for sensible
// document.title integration.
Ember.Route.reopen({
// `titleToken` can either be a static string or a function
// that accepts a model object and returns a string (or array
// of strings if there are multiple tokens).
titleToken: null,
@sheldonbaker
sheldonbaker / app.coffee
Last active February 20, 2017 11:07
A model and a couple adapters to enable batch requests against a rails-api server implementing https://github.com/arsduo/batch_api. Uses Ember.RSVP.defer() extensively to allow a BatchAdapter to call `save` against multiple records and fire off a single AJAX request.
batch = store.createRecord('batch')
foo1 = store.createRecord 'foo',
title: 'I am a foo'
foo2 = store.createRecord 'foo',
title: 'I am another foo'
promise1 = batch.saveRecord(foo1).then (foo) ->
console.log(foo)