This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
on: | |
push: | |
branches: | |
- develop | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 |
/** | |
* Script to parse a Postman backupt to Insomnia keeping the same structure. | |
* | |
* It parses: | |
* - Folders | |
* - Requests | |
* - Environments | |
* | |
* Notes: Insomnia doesn't accept vars with dots, if you are using you must replace yours URLs manually (see ENVIRONMENTS_EXPORTS). | |
*/ |
/** | |
* Get the width for a single line of text | |
* @param {String} text - the string of text to be measured | |
* @param {Object|HTMLElement} font - optional font styles or node to pull font styles from | |
* @return {Number} the width of the text passed in | |
*/ | |
const expando = 'text-width' + new Date().getTime() | |
const canvas = | |
typeof document === 'undefined' ? null : document.createElement('canvas') | |
const context = canvas && canvas.getContext('2d') |
This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<appSettings> | |
<!-- Virtual Directory Setup | |
assign virtualDirPath below a value like '/{path}' | |
Add below to your app code and then prepend routes with virtualDirPath | |
var virtualDirPath = process.env.virtualDirPath || ''; --> |
You don't really need a framework or fancy cutting-edge JavaScript features to do two-way data binding. Let's start basic - first and foremost, you need a way to tell when data changes. Traditionally, this is done via an Observer pattern, but a full-blown implementation of that is a little clunky for nice, lightweight JavaScript. So, if native getters/setters are out, the only mechanism we have are accessors:
var n = 5;
function getN() { return n; }
function setN(newN) { n = newN; }
console.log(getN()); // 5
setN(10);
To remove a submodule you need to:
function getData() { | |
var deferred = $.Deferred(); | |
$.ajax({ | |
'url': 'http://google.com', | |
'success': function(data) { | |
deferred.resolve('yay'); | |
}, | |
'error': function(error) { | |
deferred.reject('boo'); |
// Set up "namespace." | |
var APP = APP || {}; | |
// `Shared settings. | |
//---------------------------------------------------------------------------------------------------- | |
APP.config = APP.config || {}; | |
// How long to keep cache, in minutes. | |
APP.config.cache_duration = APP.config.cache_duration || 15; |
These are my notes basically. At first i created this gist just as a reminder for myself. But feel free to use this for your project as a starting point. If you have questions you can find me on twitter @thomasf https://twitter.com/thomasf This is how i used it on a Debian Wheezy testing (https://www.debian.org/releases/testing/)
Discuss, ask questions, etc. here https://news.ycombinator.com/item?id=7445545