Skip to content

Instantly share code, notes, and snippets.

@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 / Dockerfile
Created May 1, 2021 06:44 — forked from hopsoft/Dockerfile
Dockerize your Rails app
FROM ruby:3.0-alpine
RUN apk add --no-cache --update \
ack \
bash \
build-base \
curl \
git \
htop \
less \
@fdietz
fdietz / gist:8d56fa9f3597651684a65497f8da8bd4
Last active April 25, 2021 10:53
ubuntu wsl rails setup

Setup rails

https://gorails.com/setup/windows/10

sudo apt-get install git-core zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev

sudo apt install libpq-dev

@fdietz
fdietz / .dockerignore
Created April 7, 2021 18:20
Rails Docker Compose Setup for local development
.DS_Store
.bin
.git
.gitignore
.bundleignore
.bundle
.byebug_history
.rspec
tmp
log
@fdietz
fdietz / .babelrc
Last active June 29, 2018 17:32
Phoenix Framework Webpack Integration (replacing Brunch)
{
"presets": ["es2015", "react", "babel-preset-stage-0"]
}
@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);
@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 / 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: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:18
Recipes with Angular.js: Controllers - Assigning a Default Value to a Model
function MyCtrl($scope) {
$scope.value = "some value";
}