Skip to content

Instantly share code, notes, and snippets.

View jesusmacedo's full-sized avatar

Jesus Macedo jesusmacedo

View GitHub Profile
@jesusmacedo
jesusmacedo / media-query.css
Created July 7, 2019 00:10 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@jesusmacedo
jesusmacedo / app.component.ts
Created October 23, 2018 20:05 — forked from nrobinaubertin/app.component.ts
Exemple of ngb-date-parser-formatter implementation (ng-bootstrap)
import { NgbDatepickerConfig, NgbDateParserFormatter } from '@ng-bootstrap/ng-bootstrap';
import { NgbDateFRParserFormatter } from "./ngb-date-fr-parser-formatter"
@Component({
providers: [{provide: NgbDateParserFormatter, useClass: NgbDateFRParserFormatter}]
})
export class AppComponent {}
@jesusmacedo
jesusmacedo / git-commands.txt
Created October 19, 2016 16:23
Useful git commands
// List all local-remote branches
git branch -a
// Clean up all the deleted remote branches in the local data
git remote prune origin
@jesusmacedo
jesusmacedo / delete-repo-files.txt
Last active October 7, 2016 04:29
Delete remote files and folders
git rm --cached <filename>
git rm --cached -r <dir_name>
// delete all .DS_Store occurrences
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
// add .DS_Store to .gitignore
.DS_Store
git commit -m "Removed folder from repository"
git push origin master
// index.html <base href="/"> always after <title></title>
<title></title>
<base href="/">
// app.js
.config(['$locationProvider',
function ($locationProvider) {
// ...
$locationProvider.html5Mode({
enabled: true,
@jesusmacedo
jesusmacedo / Regular Expressions
Last active August 25, 2016 15:30
small bunch of regexps
// for: 11.00 but not: 11.11.11 || 11.111
var price = /^\d+(\.\d{2}){1}\+?$/;
@jesusmacedo
jesusmacedo / rfc regex
Created August 16, 2016 22:34 — forked from gerardorochin/rfc regex
Expresion regular para validar RFC
/^([A-Z,Ñ,&]{3,4}([0-9]{2})(0[1-9]|1[0-2])(0[1-9]|1[0-9]|2[0-9]|3[0-1])[A-Z|\d]{3})$/
@jesusmacedo
jesusmacedo / download-file.js
Last active February 9, 2016 19:13
Download a received file converted into blob.
var type = format === 'XML'?'application/xml':'application/pdf';
var filename = format === 'XML'?'EstadodeCuenta.xml':'EstadodeCuenta.pdf';
$http({
url: $scope.servicesURL + 'getFile?format='+format,
method: "GET",
headers: {
'Content-type': 'application/json'
},
responseType: 'arraybuffer'
@jesusmacedo
jesusmacedo / detectIE.js
Created January 25, 2016 19:06
Detect any version of IE
/**
* detect IE
* returns version of IE or false, if browser is not Internet Explorer
*/
function detectIE() {
var ua = window.navigator.userAgent;
var msie = ua.indexOf('MSIE ');
// IE 10 or older => return version number
if (msie > 0)
/**
* Return a timestamp with the format "m/d/yy h:MM:ss TT"
* @type {Date}
*/
function timeStamp() {
// Create a date object with the current time
var now = new Date();
// Create an array with the current month, day and time