Skip to content

Instantly share code, notes, and snippets.

Fred King devfred

Block or report user

Report or block devfred

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
@devfred
devfred / nginx.conf
Created Nov 16, 2016 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@devfred
devfred / haproxy.cfg
Created Nov 16, 2016 — forked from patmandenver/haproxy.cfg
haproxy with letsencrypt forwarding
View haproxy.cfg
global
log 127.0.0.1 syslog
maxconn 1000
user haproxy
group haproxy
daemon
defaults
log global
@devfred
devfred / nginx.conf
Created Nov 16, 2016 — forked from patmandenver/nginx.conf
nginx letsencrypt file
View nginx.conf
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
multi_accept on;
@devfred
devfred / audio-api-wrapper.ts
Last active Apr 4, 2019
Typescript: HTML5 Audio Wrapper for angular2
View audio-api-wrapper.ts
/**
* @class
* @description
* Wrapper for HTML5 audio.
*/
import {Injectable, NgZone} from 'angular2/core';
import {Observer} from 'rxjs/Observer';
import {Observable} from 'rxjs/Observable';
declare var AudioContext:any;
View updatequerystringparam.js
var UpdateQueryStringParameter = function(uri, key, value) {
var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
var separator = uri.indexOf('?') !== -1 ? "&" : "?";
if (uri.match(re)) {
return uri.replace(re, '$1' + key + "=" + value + '$2');
}
else {
return uri + separator + key + "=" + value;
}
};
@devfred
devfred / gist:586f9604266c342b788e
Last active Dec 6, 2015
Configure github auth in jspm
View gist:586f9604266c342b788e
jspm registry config github
@devfred
devfred / view.ascx
Created Oct 22, 2015 — forked from SCullman/view.ascx
DNN, ko and localization
View view.ascx
<script>
var resources = <%=Resources%>;
var viewModel = {localize:resources};
ko.applyBindings(viewModel);
</script>
<span data-bind="text:localize.Message"></span>
<span data-bind="text:localize.Message_Help"></span>
@devfred
devfred / titanium_app.js
Last active Aug 29, 2015
Titanium app - open map/navigation app in android from WebView
View titanium_app.js
var Bind = function(evtName, handler){
Ti.App.addEventListener('app:' + evtName, handler);
};
var NavigateTo = function(e){
Ti.Platform.openURL('http://maps.google.com/maps?daddr=' + e.dest +'&directionsmode=driving');
};
Bind('NavigateTo', NavigateTo);
@devfred
devfred / node-exec.js
Created Jul 12, 2015
Execute command using node
View node-exec.js
var exec = require('child_process').exec;
var child;
child = exec('msbuild', function (error, stdout, stderr) {
console.log('stdout: ' + stdout);
console.log('stderr: ' + stderr);
if (error !== null) {
console.log('exec error: ' + error);
}
});
View gist:003877918a616b8c6ee9
<staticContent>
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
<mimeMap fileExtension=".m4v" mimeType="video/m4v" />
<mimeMap fileExtension=".ogg" mimeType="video/ogg" />
<mimeMap fileExtension=".ogv" mimeType="video/ogg" />
<mimeMap fileExtension=".webm" mimeType="video/webm" />
<mimeMap fileExtension=".oga" mimeType="audio/ogg" />
<mimeMap fileExtension=".spx" mimeType="audio/ogg" />
You can’t perform that action at this time.