Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Working From a Cafe

tonymtz tonymtz

💻
Working From a Cafe
View GitHub Profile
@tonymtz
tonymtz / class-based vs functional components.jsx
Created Jun 1, 2020
class-based vs functional components
View class-based vs functional components.jsx
// class-based component
class Text extends React.Component {
render() {
return <span>{this.props.children}</span>
}
}
// functional component
const Text = props => {
return <span>{props.children}</span>;
@tonymtz
tonymtz / composition over inheritance code example.jsx
Created Jun 1, 2020
Composition over inheritance code example
View composition over inheritance code example.jsx
// Ugly way
const Text = () => {
// ... some implementation ...
}
class H1 extends Text {
// ... override some implementation ...
}
@tonymtz
tonymtz / PlayMusic.cs
Created Sep 24, 2019
Unity Audio Manager for Sfx and Music
View PlayMusic.cs
using UnityEngine;
public class PlayMusic : PlaySfx {
[SerializeField] private bool repeat;
public override void Play() {
soundManagerController.PlaySfx(audioClip, volume);
}
void OnDestroy() {
View Install postgres 9.4 on ubuntu 18.04.sh
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt update
sudo apt install postgresql-9.4
View hb_ubuntu_installation.md

Goodies:

  1. zsh & oh-my-zsh
  2. zsh-autosuggestion & zsh-syntax-highlighting plugins. Add git and history
  3. docker-ce and docker-compose

Mandatory:

  1. Install rbenv and nodenv
  2. Ruby 2.5.3
  3. Node 12.16.1
  4. Install yarn
View Oh my zsh with autosuggestions & syntax-highlighting.md

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
View scriptillos.md

Useful scripts for development.

Kill process listening a given port. I.e. 3500.

$ kill $(lsof -t -i :3500)

Aliases for HB.

alias godev='cd ~/workspace/homebase1'
View spellcasters-privacy-policy.md

PRIVACY POLICY SPELLCASTERS

PRIVACY POLICY MODEL FOR MOBILE APPLICATIONS

This privacy policy governs your use of the software application “Spellcasters” for mobile devices that was created by Gato Mocho. The Application is Madness Road – is the race for survival in the post-apocalyptic world.

What information does the Application obtain and how is it used?

User Provided Information

View commands.sh
sudo systemctl enable gatomocho.service
sudo systemctl start gatomocho
sudo journalctl -f -u gatomocho
View gatomocho.service
[Unit]
Description=Gatomocho service
ConditionPathExists=/home/ubuntu/work/src/gatomocho/main
After=network.target
[Service]
Type=simple
User=gatomocho
Group=gatomocho
LimitNOFILE=1024
You can’t perform that action at this time.