Skip to content

Instantly share code, notes, and snippets.


Jose Ignacio Santa Cruz G. jsanta

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jsanta on github.
  • I am jsanta ( on keybase.
  • I have a public key whose fingerprint is 8F01 7220 E8B9 4411 34E2 6E9C BF73 7302 E167 8987

To claim this, I am signing this object:

jsanta / ocLazyLoad-uiRouterDecorator.js
Created May 25, 2017
OC LazyLoad decorator for UI router
View ocLazyLoad-uiRouterDecorator.js
// From:
], function (angular) {
angular.module('oc.lazyLoad.uiRouterDecorator', ['ui.router']).config(function($stateProvider) {
jsanta / countries.js
Created Aug 18, 2017
Missing countries for mrz package
View countries.js
// Generated countries for
// taken from
var _countries = [];
_countries["AFG"] = "Afghanistan";
_countries["ALB"] = "Albania";
_countries["DZA"] = "Algeria";
_countries["ASM"] = "American Samoa";
_countries["AND"] = "Andorra";
_countries["AGO"] = "Angola";
jsanta / jsanta.zsh-theme
Created Jan 19, 2018
A customized oh-my-zsh theme. Works for me.
View jsanta.zsh-theme
local ret_status="%(?:%{$fg_bold[green]%}:%{$fg_bold[red]%})"
PROMPT='%n@%m [%*]:%d
${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"
jsanta / launch.json
Created Feb 14, 2018
launch,json for debugging using VS Code
View launch.json
"version": "0.2.0",
"configurations": [
"type": "chrome",
"request": "launch",
"name": "Launch Chromium against localhost",
"url": "http://localhost:4200/#",
"webRoot": "${workspaceFolder}",
"runtimeExecutable": "/usr/bin/chromium-browser",
jsanta / company-generator-template.txt
Last active Mar 9, 2018
Sample data generator template
View company-generator-template.txt
'{{repeat(15, 30)}}',
index: '{{index(1)}}',
guid: '{{guid()}}',
color: '{{random("blue", "green", "red", "yellow")}}',
company: '{{company().toUpperCase()}}',
country: '{{country()}}'
jsanta / toggleFilter.ts
Created Mar 9, 2018
toggleFilter function. Adds or removes a simple search filter from the activeFilters array. Then it filters the original data to a filteredData array.
View toggleFilter.ts
private activeFilters: Array<string> = [];
toggleFilter(_filter: string) {
const filterIdx: number = findIndex(this.activeFilters, (v) => v === _filter );
if (filterIdx !== -1) {
pullAt(this.activeFilters, [ filterIdx ]);
} else {
this.filteredData = filter(, (v) => includes(this.activeFilters, v.color));
jsanta / resetFilters.ts
Created Mar 9, 2018
resetFilter function, to reset all active filter to their default state (no active filters)
View resetFilters.ts
resetFilters() {
this.activeFilters = [];
this.filteredData =;
jsanta / data-grid.component.ts
Created Mar 9, 2018
DataGridComponent for displaying a filtered data grid.
View data-grid.component.ts
import { Company } from './../../data/company-data';
import { Component, OnInit, Input } from '@angular/core';
selector: 'app-data-grid',
templateUrl: './data-grid.component.html',
styleUrls: ['./data-grid.component.sass']
export class DataGridComponent implements OnInit {
jsanta / grid-page.component.html
Created Mar 9, 2018
Grid page with the button filters.
View grid-page.component.html
Press a button to visually filter results
<div class="row">
<div class="float-left pr-1"><button type="button" class="btn btn-md"
<div class="float-left pr-1"><button type="button" class="btn btn-md btn-info"
<div class="float-left pr-1"><button type="button" class="btn btn-md btn-success"