Skip to content

Instantly share code, notes, and snippets.

View chl03ks's full-sized avatar
🍊
Working from home

Dan Garcia chl03ks

🍊
Working from home
View GitHub Profile
@chl03ks
chl03ks / The Ultimate Git Congif .gitconfig
Last active December 26, 2017 19:12
My git configuration
[user]
name = Daniel
email = danielulisesverdin@gmail.com
[color]
ui = true
[alias]
co = checkout
dev = pull origin develop
mast = pull origin master
todev = push origin develop
/* Smartphones (portrait and landscape) ----------- */
@mixin Smartphones {
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
/* Styles */
@content;
}
}
/* Smartphones (landscape) ----------- */
@mixin Smartphones-Landscape {
@chl03ks
chl03ks / capitalizefirst.pipe.ts
Created August 11, 2016 15:13
An Angular 2 pipe to capitalize the first letter of a string value.
import { Pipe, PipeTransform } from '@angular/core';
/*
* Capitalize the first letter of the string
* Takes a string as a value.
* Usage:
* value | capitalizefirst
* Example:
* // value.name = daniel
* {{ value.name | capitalizefirst }}
* fromats to: Daniel
@chl03ks
chl03ks / unfollow.js
Last active December 21, 2016 16:24
Unflollow and follow all in twitter.
setInterval(function() {
t = $(".following").find(".follow-button"); //.not-following
if (!t[0]) {
window.scrollTo(0,
$(document).height());
} else {
console.log(t.attr("class"));
t.trigger("click");
}
}, 100)
import { Component, OnInit, OnDestroy } from '@angular/core';
import { ActivatedRoute, Router, Params } from '@angular/router';
import { ToastsManager } from 'ng2-toastr/ng2-toastr';
import { CustomerApi } from '../../shared/sdk/services/custom/Customer';
import { Customer } from '../../shared/sdk/models/Customer';
import { LoopBackAuth } from '../../shared/sdk/services/core/auth.service';
import * as zxcvbn from 'zxcvbn';
@chl03ks
chl03ks / MySQL_macOS_Sierra.md
Created January 2, 2017 16:20 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@chl03ks
chl03ks / database-module.js
Created February 8, 2017 18:34
Auto-migrate and Auto-update Promise Module loopback
const app = require('../server');
const log = require('debug')('boot:automigrate');
const path = require('path');
const env = process.env.NODE_ENV;
let datasources = require(path.resolve(__dirname, '../datasources.production.json'));
let models = path.resolve(__dirname, '../model-config.production.json')
@chl03ks
chl03ks / custom-eventemitter1.js
Created March 31, 2017 22:32 — forked from dominicbartl/custom-eventemitter1.js
2 ways to inherit from EventEmitter in Node.JS
var EventEmitter = require('events').EventEmitter;
module.exports = new EventEmitter();
exports.emitSomethingLater = function()
setTimeout(function() {
module.exports.emit('something');
}, 1000);
}
interface Callback { (data: any): void; }
declare class EventSource {
onmessage: Callback;
addEventListener(event: string, cb: Callback): void;
constructor(name: string);
}
@chl03ks
chl03ks / .vimrc
Created August 31, 2017 16:54
.VIMRC
"Custom vimrc file based on vim-sublime
set shell=/bin/sh
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'tpope/vim-surround'