var gulp = require('gulp'); | |
var uglify = require('gulp-uglify'); | |
var concat = require('gulp-concat'); | |
var declare = require('gulp-declare'); | |
var rename = require('gulp-rename'); | |
var locales = ['nb_NO', 'nn_NO']; | |
locales.forEach(function(locale) { | |
gulp.task(locale, function() { |
'use strict'; | |
var $ = require('gulp-load-plugins')(); | |
var _ = require('lodash'); | |
var fs = require('node-fs-extra'); | |
var gulp = require('gulp'); | |
var handlebars = require('handlebars'); | |
var path = require('path'); | |
gulp.task('handlebars', () => { |
NGINX=$(ps aux | grep -c nginx) | |
if [ $NGINX -eq 1 ] | |
then | |
echo 'stop apache, start nginx'; | |
sudo apachectl stop; sudo nginx; | |
else | |
echo 'stop nginx, start apache'; | |
sudo nginx -s stop; sudo apachectl start; | |
fi |
function sendError(message, url, lineNum) { | |
var i; | |
// First check the URL and line number of the error | |
url = url || window.location.href; | |
lineNum = lineNum || 'None'; | |
// If the error is from these 3rd party script URLs, we ignore | |
// We could also just ignore errors from all scripts that aren't our own | |
var scriptURLs = [ |
server { | |
listen 80; | |
listen [::]:80; | |
server_name yourserver.com; | |
root /path/to/your/htdocs; | |
error_page 404 /404.html | |
index index.html; |
cd ~ | |
sudo apt-get update | |
sudo apt-get install openjdk-7-jre-headless -y | |
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below | |
# NEW WAY / EASY WAY | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.0.deb | |
sudo dpkg -i elasticsearch-1.1.0.deb |
#Four Ways To Do Pub/Sub With jQuery and jQuery UI (in the future)
Between jQuery 1.7 and some of work going into future versions of jQuery UI, there are a ton of hot new ways for you to get your publish/subscribe on. Here are just four of them, three of which are new.
(PS: If you're unfamiliar with pub/sub, read the guide to it that Julian Aubourg and I wrote here http://msdn.microsoft.com/en-us/scriptjunkie/hh201955.aspx)
##Option 1: Using jQuery 1.7's $.Callbacks() feature:
/* | |
highlight v3 !! Modified by Jon Raasch (http://jonraasch.com) to fix IE6 bug !! | |
Highlights arbitrary terms. | |
<http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html> | |
MIT license. |
(function($, sr){ | |
// debouncing function from John Hann | |
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/ | |
var debounce = function (func, threshold, execAsap) { | |
var timeout; | |
return function debounced () { | |
var obj = this, args = arguments; | |
function delayed () { |