Skip to content

Instantly share code, notes, and snippets.

View aameralduais's full-sized avatar
😁
Happily coding!

Aamer Alduais aameralduais

😁
Happily coding!
  • Sana'a, Yemen
View GitHub Profile
@aameralduais
aameralduais / inotify-example.cpp
Created August 30, 2017 18:18 — forked from pkrnjevic/inotify-example.cpp
This simple inotify sample monitors changes to "./tmp". Recursive monitoring of file and directory create and delete events is implemented, but monitoring pre-existing "./tmp" subfolders is not. A C++ class containing a couple of maps is used to simplify monitoring. The Watch class is minimally integrated, so as to leave the main inotify code ea…
//
// File: inotify-example.cpp
// Date: July 16, 2013
// Author: Peter Krnjevic <pkrnjevic@gmail.com>, on the shoulders of many others
//
// This is a simple inotify sample program monitoring changes to "./tmp" directory (create ./tmp beforehand)
// Recursive monitoring of file and directory create and delete events is implemented, but
// monitoring pre-existing "./tmp" subfolders is not.
// A C++ class containing a couple of maps is used to simplify monitoring.
// The Watch class is minimally integrated, so as to leave the main inotify code
@aameralduais
aameralduais / daemon.cpp
Created August 24, 2017 07:45 — forked from alexdlaird/daemon.cpp
Useful as a starting point for a C++ based Linux daemon application.
#include <dirent.h>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iostream>
#include <stdlib.h>
#include <string>
#include <sys/stat.h>
#include <syslog.h>
@aameralduais
aameralduais / SmoothFollow2D
Created August 6, 2017 15:46 — forked from GuilleUCM/SmoothFollow2D
Unity:Camera:Smooth Follow 2D
using UnityEngine;
using System.Collections;
public class SmoothFollow2D : MonoBehaviour {
//offset from the viewport center to fix damping
public float m_DampTime = 10f;
public Transform m_Target;
public float m_XOffset = 0;
public float m_YOffset = 0;
@aameralduais
aameralduais / gist:8e12ded1e9c3cb7451c97ca36458908d
Created August 3, 2017 14:21 — forked from learncodeacademy/gist:ebba574fc3f438c851ae
Nginx Node Frontend / Load Balancer / Static Assets Caching
upstream project {
server 22.22.22.2:3000;
server 22.22.22.3:3000;
server 22.22.22.5:3000;
}
server {
listen 80;
location / {
@aameralduais
aameralduais / README.md
Created August 2, 2017 18:31 — forked from feklee/README.md
Notes and experiments concerning HTML5 streaming, with an emphasis on live streaming

Introduction

Collection of solutions for streaming via DASH, Dynamic Adaptive Streaming over HTTP, as of November 2014.

Recommended client: Chrome 38

Tool used for encoding live streams: FFmpeg

@aameralduais
aameralduais / html5-video-streamer.js
Created July 23, 2017 12:53 — forked from paolorossi/html5-video-streamer.js
Node.js HTML5 video streamer
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
*/
var http = require('http'),
fs = require('fs'),
util = require('util');
http.createServer(function (req, res) {
var path = 'video.mp4';
@aameralduais
aameralduais / async-task-queue.js
Created July 23, 2017 12:46 — forked from paolorossi/async-task-queue.js
Javascript Queue for sequencing AJAX requests and other asynchronous tasks. Demo http://jsfiddle.net/rusci/26Dud/6/
// Queue class for serializing AJAX calls.
//
// Inspired by Raynos http://stackoverflow.com/a/4797596/1194060
//
// Queue has a public append method that expects some kind of task.
// A task is a generic function passed as callback.
// Constructor expects a handler which is a method that takes a ajax task
// and a callback. Queue expects the handler to deal with the ajax and run
// the callback when it's finished
@aameralduais
aameralduais / nginx.conf
Created July 22, 2017 18:27 — forked from spikegrobstein/nginx.conf
nginx config for proxying requests for plex over a hostname-based virtualhost.
upstream plex-upstream {
# change plex-server.example.com:32400 to the hostname:port of your plex server.
# this can be "localhost:32400", for instance, if Plex is running on the same server as nginx.
server plex-server.example.com:32400;
}
server {
listen 80;
# server names for this server.
///
/// Simple pooling for Unity.
/// Author: Martin "quill18" Glaude (quill18@quill18.com)
/// Latest Version: https://gist.github.com/quill18/5a7cfffae68892621267
/// License: CC0 (http://creativecommons.org/publicdomain/zero/1.0/)
/// UPDATES:
/// 2015-04-16: Changed Pool to use a Stack generic.
///
/// Usage:
///
/*global console window describe xdescribe it expect runs waits*/
(function () {
require.paths.unshift(__dirname + '/../../../');
require('thorny/base')('./config/default.json')(function ($) {
describe('a vector2', function () {
it('should contain the following functions', function () {
var vector2 = $('thorny math vector2');
expect(typeof vector2.factory).toEqual('function');
expect(typeof vector2.centroid).toEqual('function');