Install dependencies:
sudo npm i -g forever http-server
Add server script
Copy startServer.js
to /usr/lib/startServer.js
Create service
- Copy content of
http-server
in/etc/init.d/http-server
import {TranslateLoader} from "ng2-translate/ng2-translate"; | |
import {Observable} from "rxjs/Observable"; | |
import fs = require('fs'); | |
export class TranslateUniversalLoader implements TranslateLoader { | |
constructor(private prefix: string = 'i18n', private suffix: string = '.json') {} | |
/** | |
* Gets the translations from the server | |
* @param lang |
sudo npm i -g forever http-server
Copy startServer.js
to /usr/lib/startServer.js
http-server
in /etc/init.d/http-server
In order to clarify the intellectual property license granted with Contributions from any person or entity, Locl ("Locl") must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of Locl; it does not change your rights to use your own Contributions for any other purpose.
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Locl. Except for the license granted herein to Locl and recipients of software distributed by Locl, You reserve all right, title, and interest in and to Your Contributions.
"You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with Locl. For legal entities, the entity making a Contribution and all other entities that c
Using bitwise operations is blazing fast for the VM. Here is how you can encode and use information: First you have to determine the number of operations that you need to encode to know how many bits you need, based on 2^n, where n is the number of bits, and 2^n the number of operations that you can encode.
For example if I have 5 operations, I need 3 bits (2^2 = 4 operations, and 2^3 = 8 operations). Then you can encode the operations in an enum. Each operation will have a different number, and you need to shift each operation by 32 bits - n (for 5 operations and 3 bits, we will shift by 32-3=29).
/** | |
* Forwards events from a floating mask element to the underlying document, except for scrolling | |
*/ | |
var forwardEvents = function(element) { | |
var evts = [ 'dblclick', 'click', 'tap', 'doubletap', 'mousedown', 'mouseup' ]; | |
for(var i = 0, l = evts.length; i < l; i++) { | |
element.addEventListener(evts[i], function(event) { | |
var s = [0, 0], | |
x = Ext.num(event.pageX, event.clientX) - s[0], |
/* | |
* THIS IS TEMPORARY TO PATCH 2.1.1+ Core bugs | |
*/ | |
/* tslint:disable */ | |
let __compiler__ = require('@angular/compiler'); | |
import {__platform_browser_private__} from '@angular/platform-browser'; | |
import {__core_private__} from '@angular/core'; | |
let patch = false; | |
if(!__core_private__['ViewUtils']) { |
import {TranslateLoader} from "ng2-translate/ng2-translate"; | |
import {Observable} from "rxjs/Observable"; | |
import {Response, Http} from "angular2/http"; | |
export class TranslateLSLoader implements TranslateLoader { | |
constructor(private http: Http, private prefix: string = 'i18n', private suffix: string = '.json') {} | |
/** | |
* Gets the translations from the localStorage and update them with the ones from the server | |
* @param lang |
angular.module('grid'). | |
directive('limitedtextarea', function () { | |
var byteLength = function (s, b, i, c) { | |
for (b = i = 0; c = s.charCodeAt(i++); b += c >> 11 ? 3 : c >> 7 ? 2 : 1); | |
return b; | |
} | |
return { | |
restrict: 'E', | |
replace: true, |
$(document).ready(function() { | |
// let's make a case insensitive contains selector | |
$.extend($.expr[':'], { | |
'containsi': function(elem, i, match, array) { | |
return (elem.textContent || elem.innerText || '').toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0; | |
} | |
}); | |
}); | |
//filter results based on query |
public function findEncoding($str) { | |
$tab = array("UTF-8", "ASCII", "ISO-8859-1"); | |
foreach ($tab as $i) { | |
foreach ($tab as $j) { | |
$chain .= " [iconv('$i','$j','$str'): " . iconv($i, $j, "$str") . "] "; | |
} | |
} | |
return $chain; | |
} |