Skip to content

Instantly share code, notes, and snippets.

View DanyelMorales's full-sized avatar
🦆
#stayHome

Daniel V Morales DanyelMorales

🦆
#stayHome
  • Software Engineer
  • San Antonio, Texas
View GitHub Profile
@DanyelMorales
DanyelMorales / ins.txt
Created April 5, 2024 02:25
How to Configure Your iTerm Terminal for an Amazing Look:
How to Configure Your iTerm Terminal for an Amazing Look:
https://blog.protein.tech/make-your-macos-terminal-look-great-76dceb96607e
https://opensource.com/article/20/8/iterm2-zsh
https://medium.com/@jeantimex/how-to-configure-iterm2-and-vim-like-a-pro-on-macos-e303d25d5b5c
https://iterm2colorschemes.com/
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display, clear_output
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
for i in range(20):
x = np.arange(0, i, 0.1);
@DanyelMorales
DanyelMorales / healthCheck.go
Created January 24, 2022 06:27
Heartbeat healthcheck
func health() {
dowork := func(done <-chan interface{}, pulseInterval time.Duration) (<-chan interface{}, <-chan time.Time) {
hearthbeat := make(chan interface{})
results := make(chan time.Time)
go func() {
defer close(hearthbeat)
defer close(results)
pulse := time.Tick(pulseInterval)
workGen := time.Tick(2 * pulseInterval)
@DanyelMorales
DanyelMorales / add_intellij_launcer
Created September 20, 2021 06:58 — forked from rob-murray/add_intellij_launcer
Add Intellij launcher shortcut and icon for ubuntu
// create file:
sudo vim /usr/share/applications/intellij.desktop
// add the following
[Desktop Entry]
Version=13.0
Type=Application
Terminal=false
Icon[en_US]=/home/rob/.intellij-13/bin/idea.png
Name[en_US]=IntelliJ
@DanyelMorales
DanyelMorales / or.go
Created August 11, 2021 20:26
OR CHANNELS
package main
import (
"fmt"
"time"
)
func main() {
var or func(channels ...<-chan interface{}) <-chan interface{}
or = func(channels ...<-chan interface{}) <-chan interface{} {
@DanyelMorales
DanyelMorales / phpArraySerialization.pl
Last active March 30, 2021 23:26
Serialize a perl array into a php array
#!/usr/bin/perl
use strict;
use warnings;
sub serializeToPhpArray {
my @arr = @{$_[0]};
my $content = "a:".@arr.":{";
for (my $i=0; $i < @arr; $i++) {
my $val = $arr[$i];
import java.util.Scanner;
public class PascalTriangle
{
public static void main(String a[]) throws Exception
{
int num=0;
Scanner scan=new Scanner(System.in);
System.out.println("Enter number of rows for pascal triangle:");
@DanyelMorales
DanyelMorales / ContainsSameLetters.java
Created June 16, 2020 22:14
Different approaches to detect repeated letters
package com.company;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
@DanyelMorales
DanyelMorales / findElements.js
Created December 12, 2018 15:42
find Elements start with @
Parser.prototype.findElements = function(block, filename) {
var elements = [];
// Replace Linebreak with Unicode
block = block.replace(/\n/g, '\uffff');
// Elements start with @
var elementsRegExp = /(@(\w*)\s?(.+?)(?=\uffff[\s\*]*@|$))/gm;
var matches = elementsRegExp.exec(block);
@DanyelMorales
DanyelMorales / replace.js
Created December 12, 2018 15:35
Replace Linebreak with Unicode
// Replace Linebreak with Unicode
block = block.replace(/\n/g, '\uffff');