Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,| /*! | |
| * gulp | |
| * $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev | |
| */ | |
| // Load plugins | |
| var gulp = require('gulp'), | |
| sass = require('gulp-ruby-sass'), | |
| autoprefixer = require('gulp-autoprefixer'), | |
| cssnano = require('gulp-cssnano'), |
Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| // XORCipher - Super simple encryption using XOR and Base64 | |
| // | |
| // Depends on [Underscore](http://underscorejs.org/). | |
| // | |
| // As a warning, this is **not** a secure encryption algorythm. It uses a very | |
| // simplistic keystore and will be easy to crack. | |
| // | |
| // The Base64 algorythm is a modification of the one used in phpjs.org | |
| // * http://phpjs.org/functions/base64_encode/ | |
| // * http://phpjs.org/functions/base64_decode/ |
| /*global document */ | |
| /** | |
| * define document.querySelector & document.querySelectorAll for IE7 | |
| * | |
| * A not very fast but small hack. The approach is taken from | |
| * http://weblogs.asp.net/bleroy/archive/2009/08/31/queryselectorall-on-old-ie-versions-something-that-doesn-t-work.aspx | |
| * | |
| */ | |
| (function () { | |
| var |
| var svg = document.getElementById('graph'), | |
| xml = new XMLSerializer().serializeToString(svg), | |
| data = "data:image/svg+xml;base64," + btoa(xml), | |
| img = new Image() | |
| img.setAttribute('src', data) | |
| document.body.appendChild(img) |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta name='description' content='AngularJS + jQuery UI Drag-n-Drop'/> | |
| <title>JS Bin</title> | |
| <link href='//ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css' rel='stylesheet'/> | |
| <link href='//netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap.min.css' rel='stylesheet'> |
| <!DOCTYPE html> | |
| <html ng-app="App"> | |
| <head> | |
| <meta name="description" content="AngularJS + jQuery UI Drag-n-Drop" /> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
| <script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.0.1/angular.min.js"></script> | |
| <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" /> | |
| <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap.min.css" rel="stylesheet"> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script> | |
| <meta charset=utf-8 /> |
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
| #!/bin/bash | |
| # herein we backup our indexes! this script should run at like 6pm or something, after logstash | |
| # rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas, | |
| # compress the data files, create a restore script, and push it all up to S3. | |
| TODAY=`date +"%Y.%m.%d"` | |
| INDEXNAME="logstash-$TODAY" # this had better match the index name in ES | |
| INDEXDIR="/usr/local/elasticsearch/data/logstash/nodes/0/indices/" | |
| BACKUPCMD="/usr/local/backupTools/s3cmd --config=/usr/local/backupTools/s3cfg put" | |
| BACKUPDIR="/mnt/es-backups/" | |
| YEARMONTH=`date +"%Y-%m"` |