Skip to content

Instantly share code, notes, and snippets.

alfchee / NumeroALetras.js
Last active Sep 26, 2022
Código en JavaScript que convierte números a letras, bastante útil para formularios de documentos contables y similares
View NumeroALetras.js
// NumeroALetras
// The MIT License (MIT)
// Copyright (c) 2015 Luis Alfredo Chee
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
alfchee / git-prune.bash
Created May 3, 2021
Delete all merged branches in remote, excluding branches `dev` and `main`.
View git-prune.bash
git branch --merged | egrep -v "(^\*|main|dev)" | xargs git branch -d
alfchee / debugg_trace.php
Created Oct 26, 2018
Trace the stack of calls for your break var_dump()
View debugg_trace.php
// useful line of code to generate a backtrace
array_walk(debug_backtrace(),create_function('$a,$b','print "{$a[\'function\']}()(".basename($a[\'file\']).":{$a[\'line\']}); ";')); die();
alfchee / TimelineComponent.js
Created Sep 7, 2018
Idea about time ranges solutions
View TimelineComponent.js
import { Component, OnInit, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
selector: 'app-timeline',
templateUrl: './timeline.component.html',
styleUrls: ['./timeline.component.css']
export class TimelineComponent implements OnInit {
alfchee / redis-server
Created Jul 16, 2018 — forked from nexdrew/redis-server
Example files for running Redis on CentOS 7 (after manual install)
View redis-server
/var/lib/redis/logs/redis.log {
rotate 14
alfchee / simplesaml.conf
Created Jul 14, 2018
Simple SAML PHP configuration, to incluse SimpleSAMLPHP as part of your
View simplesaml.conf
listen 80;
location ^~ /simplesaml {
alias /var/simplesamlphp/www;
location ~ ^(?<prefix>/simplesaml)(?<phpfile>.+?\.php)(?<pathinfo>/.*)?$ {
include fastcgi_params;
fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;
alfchee /
Created Jun 7, 2018 — forked from torgeir/
Redis 2.4.8 Install on Ubuntu 10.04

Installation commands:

$ wget
$ tar xvfz redis-2.4.8.tar.gz 
$ cd redis-2.4.8/
$ mkdir -p /opt/redis
$ make PREFIX=/opt/redis install
$ cp redis.conf /opt/redis/redis.conf
$ chown -R redis:redis /opt/redis
alfchee / slice_exists.go
Created Apr 26, 2018 — forked from r6m/slice_exists.go
golang check if item exists in slice
View slice_exists.go
package main
func main() {
items := []int{1,2,3,4,5,6}
fmt.Println(SliceExists(items, 5)) // returns true
alfchee /
Created Nov 27, 2017
This simple script will prune the removed branches on remote, list the branches that has a state of "gone" and then remove them
git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -d
alfchee /
Created Jul 7, 2017 — forked from Rajeshr34/
Wkhtmltopdf With Patched QT Setup Ubuntu 16+
cd ~
tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
mv wkhtmltox/bin/wkhtmlto* /usr/bin
apt-get install -y openssl build-essential libssl-dev libxrender-dev git-core libx11-dev libxext-dev libfontconfig1-dev libfreetype6-dev fontconfig