Skip to content

Instantly share code, notes, and snippets.

View ddewaele's full-sized avatar

Davy De Waele ddewaele

View GitHub Profile

Ajax Setup

Cover all AJAX calls .... when an AJAX call is done on your site that results in a 401 or 403, redirect the user to either the login page or an access denied page.

$.ajaxSetup({
  statusCode: {
      401: function(){
          // Redirec the to the login page.
          showLoginButton();

window.location.replace('/#login');

int8_t answer;
int onModulePin= 9;
char data[512];
int data_size;
char aux_str[100];
char aux;
int x = 0;
BUILDFOLDER=/home/davy/Arduino/build/src
ARDUINOHOME=/home/davy/Software/arduino-1.0.5
LIBFOLDER=/home/davy/Arduino/libs/
# need to take care of creating directories automatically
# need to take care of casing.
# need to take care of embedded.cpp
# need to have a core.a available in #BUILDFOLDER
Davys-MacBook-Air:BackboneDemo2 ddewaele$ npm install
npm WARN package.json [email protected] No README.md file found!
npm http GET https://registry.npmjs.org/grunt-contrib-jst
npm http GET https://registry.npmjs.org/load-grunt-tasks
npm http GET https://registry.npmjs.org/jshint-stylish
npm http GET https://registry.npmjs.org/grunt-contrib-concat
npm http GET https://registry.npmjs.org/grunt-contrib-copy
npm http GET https://registry.npmjs.org/grunt-contrib-compass
npm http GET https://registry.npmjs.org/grunt-contrib-jshint
npm http GET https://registry.npmjs.org/grunt-contrib-uglify
@ddewaele
ddewaele / yo-backbone.txt
Created February 6, 2014 23:03
Yo backbone output
Davys-MacBook-Air:BackboneTest ddewaele$ yo backbone
_-----_
| |
|--(o)--| .--------------------------.
`---------´ | Welcome to Yeoman, |
( _´U`_ ) | ladies and gentlemen! |
/___A___\ '__________________________'
| ~ |
__'.___.'__
/* Include the software serial port library */
#include <SoftwareSerial.h>
/*
On a mac , connect with the bluetooth module like this:
$ screen /dev/tty.HC-06-DevB
Davys-MacBook-Air:com.ecs.vdm.web.grunt ddewaele$ grunt build
Running "clean:dist" (clean) task
Cleaning .tmp...OK
Cleaning dist/404.html...OK
Cleaning dist/bower_components...OK
Cleaning dist/favicon.ico...OK
Cleaning dist/fonts...OK
Cleaning dist/images...OK
Cleaning dist/index.html...OK
Cleaning dist/locales...OK
@ddewaele
ddewaele / npm-errors.txt
Created March 31, 2014 15:05
unclear why these npm "invalid targets" errors occur.
Davys-MacBook-Air:BackboneTest5 ddewaele$ npm install
npm WARN package.json [email protected] No README.md file found!
npm http GET https://registry.npmjs.org/grunt-contrib-imagemin
npm http 304 https://registry.npmjs.org/grunt-contrib-imagemin
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/image-min
npm http GET https://registry.npmjs.org/chalk
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/pretty-bytes
npm http 304 https://registry.npmjs.org/chalk
@ddewaele
ddewaele / npm-outputs.txt
Created March 31, 2014 15:33
Various errors, among other : Error: No compatible version found: chalk@'^0.4.0'
npm WARN package.json [email protected] No README.md file found!
npm http GET https://registry.npmjs.org/grunt
npm http GET https://registry.npmjs.org/grunt-contrib-copy
npm http GET https://registry.npmjs.org/grunt-contrib-cssmin
npm http GET https://registry.npmjs.org/grunt-contrib-connect
npm http GET https://registry.npmjs.org/grunt-contrib-imagemin
npm http GET https://registry.npmjs.org/grunt-contrib-clean
npm http GET https://registry.npmjs.org/grunt-contrib-concat
npm http GET https://registry.npmjs.org/grunt-contrib-jst
npm http GET https://registry.npmjs.org/grunt-contrib-coffee
@ddewaele
ddewaele / npm-log.txt
Created March 31, 2014 15:35
full log
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'install' ]
2 info using [email protected]
3 info using [email protected]
4 verbose read json /Users/ddewaele/Projects/BackboneTest5/package.json
5 warn package.json [email protected] No README.md file found!
6 verbose readDependencies using package.json deps
7 verbose install where, deps [ '/Users/ddewaele/Projects/BackboneTest5',
7 verbose install [ 'grunt',
7 verbose install 'grunt-contrib-copy',