Skip to content

Instantly share code, notes, and snippets.

View santiblanko's full-sized avatar
🎯
Focusing

santiblanko santiblanko

🎯
Focusing
View GitHub Profile
var people = [{
name:"santiago",
age:25,
country:"españa"
},{
name:"la",
age:23,
country:"colombia"
},{
name:"juan",
.map(o => o.value)
.reduce((a, b) => a + b, 0);
@santiblanko
santiblanko / gist:452df1f1cf403ce11f65ae8d77135ed0
Last active August 8, 2016 03:23
search pipe angular2 basic
@Pipe({
name: 'showfilter',
pure: true
})
export class ShowPipe {
transform(value, term) {
return value.filter(item => {
if( item.name.toLowerCase().indexOf(term) >= 0 ) return item;
});
}
// opciones del compilador
// https://www.typescriptlang.org/docs/handbook/compiler-options.html
{
"compileOnSave": false, //genera todos los archivos de tsconfig.json al guardar
"compilerOptions": {
"declaration": false, // no va a buscar declaraciones (archivos d.ts)
"emitDecoratorMetadata": true, // agrega metadatos a los decorators
"experimentalDecorators": true, // habilitamos decoradores
"mapRoot": "/", //ruta donde se dirigira a buscar los archivos sourcemap
"module": "commonjs", // el tipo de generación de modulos cuando compile
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

##Example Task: Make 2 parallel (simultaneous) async calls, then one async call when they've resolved##

##The Good Way: Promises##

//with bluebird library
var parallelCalls = [
  getUrl('/api/profile'),
  getUrl('/api/accounts')
];
//spread is like .then(), except it apply()s the array of responses as individual arguments
componentWillMount(){
// Called the first time the component is loaded right before the component is added to the page
this.search();
}
componentDidMount(){
// Called after the component has been rendered into the page
}
componentWillReceiveProps(nextProps){
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
<?php
class Facturacion_EgresosController extends Mantum_RestController
{
/**
* Se utiliza para cargar la lista de egresos.
*
* @author santiago.blanco
* @date 24/05/2016
*/
<?php
class Facturacion_EgresosController extends Mantum_RestController
{
/**
* Se utiliza para cargar la lista de egresos.
*
* @author santiago.blanco
* @date 24/05/2016
*/