Skip to content

Instantly share code, notes, and snippets.

View smorcuend's full-sized avatar
🎯
Focusing

Sergio Morcuende smorcuend

🎯
Focusing
View GitHub Profile
@smorcuend
smorcuend / nvm_installer.sh
Created December 26, 2015 15:42
NVM installation on Linux (based on Debian distros)
sudo apt-get update
sudo apt-get install build-essential libssl-dev
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash
nvm install stable
nvm alias default stable
nvm use default
@smorcuend
smorcuend / .bashrc.partial
Created December 5, 2015 20:58
git commands aliases
## GIT ALIASES ##
alias gitb='git branch -a -v'
alias gits='git status'
alias gitd='git diff'
alias gita='git add'
alias gitph='git push'
alias gitl='git log'
alias gitr='git remote'
function gitp {
@smorcuend
smorcuend / $logDecorator.js
Last active September 13, 2015 17:57
AngularJS - Disable logging
(function() {
var app = angular.module('myApp', []);
app.config(['$provide', function($provide) {
// decorates the $log instance to disable logging
$provide.decorator('$log', ['$delegate',
function($delegate) {
var $log, enabled = true;
$log = {
@smorcuend
smorcuend / gist:c6d60d339881ebb2e48d
Last active August 29, 2015 14:27 — forked from Mithrandir0x/gist:3639232
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@smorcuend
smorcuend / iconService(partial).js
Created August 9, 2015 10:03
mdIconService from material-angularjs modified for support <use> tag on inline SVG sprites. (angular/material/src/components/icon/iconService.js)
/**
* Loads the reference of SVG element from icon set sprite using inline svg reference
*/
function Icon(el, config) {
if (el.tagName != 'svg') {
el = angular.element('<svg><use xlink:href="' + config.url + '#' + el.id + '"/></svg>')[0];
}
// Inject the namespace if not available...
if (!el.getAttribute('xmlns')) {
@smorcuend
smorcuend / md-svg-icon.js
Created June 15, 2015 20:21
md-svg-icon angular directive for material angular
var mdSvgIcon = angular.module('mdSvgIcon', []);
mdSvgIcon.directive('mdSvgIcon', function() {
return {
name: 'md-svg-icon',
template: '<svg class="icon" role="img" title="{{title}}"><use xlink:href="{{iconSprite}}"/></svg>',
restrict: 'E',
scope: {},
link: function preLink($scope, $element, $attrs) {
$scope.title = $attrs.title || $attrs.iconSprite;
@smorcuend
smorcuend / .jshintrc
Last active August 29, 2015 14:22
My .jshintrc file for angular projects
{
"node": true,
"browser": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 4,

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Composer

Composer Related