Skip to content

Instantly share code, notes, and snippets.

View yacafx's full-sized avatar
💭
Coding... 👽👾💻🕹

Sergio Brito yacafx

💭
Coding... 👽👾💻🕹
View GitHub Profile
@yacafx
yacafx / orderby.pipe.ts
Created January 3, 2018 00:30
Order by text or number for angular
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'orderBy' })
export class OrderBy implements PipeTransform {
transform(array, orderBy, asc = true) {
if (!orderBy || orderBy.trim() == "") {
return array;
}
@yacafx
yacafx / TopoJSON simplify.md
Last active November 18, 2017 06:20 — forked from frogcat/20170714.md
TopoJSON simplify demo

TopoJSON simplify demo

@yacafx
yacafx / http.conf
Created November 3, 2017 16:11
Apache configuration
# ----------------------------------------------------------------------
# Apache configuration file
# This file is best used in /apache2/httpd.conf, not use in .htaccess because works slower.
#
# Rules takes from:
# - HTML5BoilerPlate: https://github.com/h5bp/html5-boilerplate/
# - W3 Edge: http://www.w3-edge.com/
# - Yahoo! Best Practices: http://developer.yahoo.com/performance/rules.html
# - Caching Tutorial: http://www.mnot.net/cache_docs/
# ----------------------------------------------------------------------
cities: [
{ name: "Tokyo", coordinates: [139.6917,35.6895], population: 37843000 },
{ name: "Jakarta", coordinates: [106.8650,-6.1751], population: 30539000 },
{ name: "Delhi", coordinates: [77.1025,28.7041], population: 24998000 },
{ name: "Manila", coordinates: [120.9842,14.5995], population: 24123000 },
{ name: "Seoul", coordinates: [126.9780,37.5665], population: 23480000 },
{ name: "Shanghai", coordinates: [121.4737,31.2304], population: 23416000 },
{ name: "Karachi", coordinates: [67.0099,24.8615], population: 22123000 },
{ name: "Beijing", coordinates: [116.4074,39.9042], population: 21009000 },
{ name: "New York", coordinates: [-74.0059,40.7128], population: 20630000 },
@yacafx
yacafx / mx.json
Created October 11, 2017 17:22
Mx topo json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yacafx
yacafx / default
Last active February 9, 2023 20:07
NGNIX configuration for run node app and php app at the same same time - This configuration made Node and Wordpress working at the same time on two different routes.
### /etc/nginx/sites-available/default
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.php;
@yacafx
yacafx / commit-msg
Created March 15, 2017 15:15
ESLint 3.0 Git Pre Commit Hook
#!/bin/bash
files=$(git diff --cached --name-only | grep '\.jsx\?$')
# Prevent ESLint help message if no files matched
if [[ $files = "" ]] ; then
exit 0
fi
failed=0
for file in ${files}; do
@yacafx
yacafx / convert-image-to-base64.js
Created November 4, 2016 11:27 — forked from HereChen/convert-image-to-base64.js
convert image to base64
/**
* version1: convert online image
* @param {String} url
* @param {Function} callback
* @param {String} [outputFormat='image/png']
* @author HaNdTriX
* @example
convertImgToBase64('http://goo.gl/AOxHAL', function(base64Img){
console.log('IMAGE:',base64Img);
})
@yacafx
yacafx / gulpfile.js
Created June 17, 2016 17:52
Gulp configuration with local web server, livereload, browser-sync and sass compilation
/*****
*
* Install first this modules as devDependencies
*
* npm install browser-sync gulp gulp-autoprefixer gulp-connect gulp-load-plugins gulp-sass --save-dev
*
******/
var gulp = require('gulp'),
$ = require('gulp-load-plugins')(),
@yacafx
yacafx / base.css
Created September 26, 2014 00:16
Estilos Angular
/*-------------------------
Simple reset
--------------------------*/
*{
margin:0;
padding:0;
}