Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# node.js using PPA (for statsd)
sudo apt-get install python-software-properties
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm
# Install git to get statsd
sudo apt-get install git
<h1>Alert</h1>
<p>Bootstrap JS</p>
<div class="alert fade in">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>Holy guacamole!</strong> Best check yo self, you're not looking too good.
</div>
<p></p><a ng-click="alert=true">Open Alert (AngularJS)</a></p>
<div class="alert fade" ng-class="{in:alert}">
<button type="button" class="close" ng-click="alert=false">×</button>
@fdietz
fdietz / app.js
Created February 19, 2013 19:15
Recipes with Angular.js: Controllers - Changing a Model Value with a Controller Function
function MyCtrl($scope) {
$scope.value = 1;
$scope.incrementValue = function(value) {
$scope.value += 1;
};
}
@fdietz
fdietz / app.js
Created February 19, 2013 19:18
Recipes with Angular.js: Controllers - Assigning a Default Value to a Model
function MyCtrl($scope) {
$scope.value = "some value";
}
@fdietz
fdietz / app.js
Created February 19, 2013 19:18
Recipes with Angular.js: Controllers - Encapsulating a Model Value with a Controller Function
function MyCtrl($scope) {
$scope.value = 1;
$scope.getIncrementedValue = function() {
return $scope.value + 1;
};
}
@fdietz
fdietz / app.js
Created February 19, 2013 19:19
Recipes with Angular.js: Controllers - Responding to Scope Changes
function MyCtrl($scope) {
$scope.name = "";
$scope.$watch("name", function(newValue, oldValue) {
if (newValue.length > 0) {
$scope.greeting = "Greetings " + newValue;
}
});
}
@fdietz
fdietz / app.js
Created February 19, 2013 19:20
Recipes with Angular.js: Controllers - Sharing Models Between Nested Controllers
var app = angular.module("MyApp", []);
app.controller("MyCtrl", function($scope) {
$scope.name = "Peter";
$scope.user = {
name: "Parker"
};
});
app.controller("MyNestedCtrl", function($scope) {
@fdietz
fdietz / app.js
Created February 19, 2013 19:21
Recipes with Angular.js: Controllers - Sharing Code Between Controllers using Services
var app = angular.module("MyApp", []);
app.factory("UserService", function() {
var users = ["Peter", "Daniel", "Nina"];
return {
all: function() {
return users;
},
first: function() {
@fdietz
fdietz / gist:8222432
Created January 2, 2014 17:04
nginx-upload-module-2.2.0/ngx_http_upload_module.c
--- nginx-upload-module-2.2.0/ngx_http_upload_module.c 2010-09-27 20:54:15.000000000 +0200
+++ nginx-1.3.9/debian/modules/nginx-upload-module/ngx_http_upload_module.c 2012-12-12 17:44:32.000000000 +0100
@@ -233,6 +233,17 @@
unsigned int raw_input:1;
} ngx_http_upload_ctx_t;
+static void ngx_http_read_client_request_body_handler(ngx_http_request_t *r);
+static ngx_int_t ngx_http_do_read_client_request_body(ngx_http_request_t *r);
+
+static ngx_int_t ngx_http_write_request_body(ngx_http_request_t *r);

Why you should look into Angular.js

Web apps are getting more and more complicated these days. More and more business logic moves from the backend to the frontend. Libraries and frameworks of the past weren't built with these new requirements in mind. For example using jQuery to manage a large and complex web app quickly ends up in a very difficult to maintain code base.

Fortunately, a new generation of frameworks are being built to meet these challenges and Angular.js is one of them! Let me introduce you to some of the major benefits of using Angular.

Declarative user interface and databindings

Angular uses HTML to define the user interface, which is much more intuitive than defining the interface procedurally in Javascript.

Following a quick example. Give it a try using an interactive JSFiddle!