Skip to content

Instantly share code, notes, and snippets.

View m00s's full-sized avatar

Massimiliano Sartoretto m00s

View GitHub Profile
@m00s
m00s / cloudSettings
Last active July 9, 2020 11:50
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-04-03T10:26:15.817Z","extensionVersion":"v3.2.7"}
@m00s
m00s / app.js
Last active January 20, 2016 08:45
Angular Controller Inheritance (Live fiddle https://jsfiddle.net/m00s/tkoprctu/5/)
angular
.module('myApp', [])
.controller('baseController', baseCtrl)
.controller('childController', childCtrl);
function baseCtrl() {
var vm = this;
vm.message = 'Base controller!';
// Shared logic here
@m00s
m00s / angularjs_directive_attribute_explanation.md
Created January 5, 2016 20:15 — forked from CMCDragonkai/angularjs_directive_attribute_explanation.md
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@m00s
m00s / curl-http.md
Created October 9, 2015 16:22
How to perform HTTP requests using curl

Make GET requests with extra headers:

curl --request GET 'http://www.somedomain.com/user/info/' \ --header 'sessionid:1234567890987654321'

Make GET and have the response with HTTP headers:

curl --request GET 'http://somedomain.com/' --include

Make POST with headers and body:

@m00s
m00s / VERSIONING.md
Last active October 12, 2015 21:28
Bower and npm package versioning

Versioning

Bower / Node

Bower Npm (semver) version
bower version <X.Y.Z> npm version <X.Y.Z> X.Y.Z
bower version patch npm version patch 0.0.X
bower version minor npm version minor 0.X.0
bower version major npm version major X.0.0
@m00s
m00s / README.md
Last active August 29, 2015 14:21
Use a provider to configure other factories

Like a Façade the ConfiguratorProvider take care of the entire app configuration.

So in your app instead of something like:

.config(function(firstProvider, secondProvider, thirdProvider){
    firstProvider.foo();
    secondProvider.bar();
    thirdProvider.baz();
});
@m00s
m00s / .bash_profile
Last active August 29, 2015 14:20
My OS X bash profile
export GITAWAREPROMPT=~/.bash/git-aware-prompt
source $GITAWAREPROMPT/main.sh
export PS1="\[\033[0;35m\]\u\[\033[1;33m\]: \w \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ "
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
# -----------------------------
# 1. IMPROVING THE SHELL
@m00s
m00s / Makefile
Last active August 29, 2015 14:20
AngularJS constants uses
# Main entry point
SOURCE = constants.js
# The dependencies (other than node_modules/**)
LIBS = $(shell ls package.json)
# The target
TARGET = bundle.js
# Binaries