Skip to content

Instantly share code, notes, and snippets.

View juanlopezdev's full-sized avatar

Juan López juanlopezdev

View GitHub Profile
@juanlopezdev
juanlopezdev / angular-fbxnd.js
Created November 15, 2016 22:19 — forked from joseluisq/angular-fbxnd.js
Facebook JSDK Factory for Angular 1.x
(function (angular) {
angular
.module('fbxnd', [])
.factory('FBXnd', function ($q) {
/**
* window.FB extended class
* José Luis Quintana <https://git.io/joseluisq | MIT License
* Reference: https://developers.facebook.com/docs/javascript/reference/FB.api
@juanlopezdev
juanlopezdev / angular_utils.md
Last active April 19, 2016 16:09 — forked from joseluisq/angular_utils.md
Angular 1.x Utilities

Angular 1.x Utilities

Moment Filter

app.filter('moment', function () {
  return function (input, momentFn) {
    var args = Array.prototype.slice.call(arguments, 2),
        obj = moment(input);
    return obj[momentFn].apply(obj, args);
 };
@juanlopezdev
juanlopezdev / JQUERY_utils_funtions.js
Last active May 2, 2016 17:35 — forked from joseluisq/jquery_utils_funtions.js
Funciones útiles en JQuery
/**
* Some jQuery utils functions
*/
(function($){
$.fn.isEmpty=function(){
return !!$(this).val()==null||$(this).val().length==0||/^\s+$/.test($(this).val());
};
$.fn.isEmail=function(){
return !!(/\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/.test($(this).val()));
@juanlopezdev
juanlopezdev / SCSS_Section_layouts.scss
Last active August 29, 2015 14:16 — forked from joseluisq/section_layouts.scss
SCSS: Section layouts
// Sections
$sections: (
'section-1',
'section-2',
'section-3',
'section-4',
'section-5');
// Section colors
$section-colors: (#6b9297, #f2be61, #7bc2a3, #bd8c88, #d02556);
@juanlopezdev
juanlopezdev / JAVASCRIPT_default_value_for_param.js
Last active May 2, 2016 17:32 — forked from joseluisq/default_value_for_param.js
Inicializar variables en una funcion en "Javascript"
function myfunction(param) {
return (param === undefined) ? true : param;
}
/* Testing 'myfunction' in console..
// Default value example
> myfunction();
true
@juanlopezdev
juanlopezdev / GIT_useful_commands.md
Last active June 5, 2019 20:57 — forked from joseluisq/git_useful_commands.md
[GIT Comandos útiles] Utilidades para manejar y resolver algunos problemas de git #git #utilidades

** Basic: Init git and upload files **

git init # Inicializar
git add . # Añadir archivos
git status # Estado
git commit . -m "Mi comentario"
git remote add origin https://github.com/user/repo.git # Definir repositorio
git push origin master

Sublime Text Essential Plugins

Here some very essential and useful plugins for Sublime Text Editor.
First, it's necessary to install Package Control.

  • AutoFileName : Autocomplete Filenames in Sublime Text.
  • EditorConfig : EditorConfig helps developers maintain consistent coding styles between different editors.
  • Emmet : Emmet is a plugin for many popular text editors which greatly improves HTML & CSS
  • SCSS : Sass support.
  • SidebarEnhancements : Provides enhancements to the operations on side bar of files and folders.
@juanlopezdev
juanlopezdev / SOCIALNETWORK_share_counts.md
Last active May 2, 2016 17:44 — forked from jonathanmoore/gist:2640302
API que permite ver cuantas veces ha sido compartido una pagina web en distintas redes sociales

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter