Skip to content

Instantly share code, notes, and snippets.

View di3goleite's full-sized avatar

Diego Leite di3goleite

View GitHub Profile
@RatoX
RatoX / ports.sh
Last active September 25, 2018 00:20
List all ports used by your user with the process name
#!/bin/bash
# This is in progress I tested it only on macOS 10.13.6
# outuput e.g:
# PID (319) Spotify -> :57621
function ports {
PORTS=$(lsof -iTCP -sTCP:LISTEN -nP)
echo "$PORTS" | awk 'match($9, /[\]|\*]+:(.*)$/) { print " PID ("$2") "$1" -> "substr($9, RSTART+1, RLENGTH-1) }'
}
@gaearon
gaearon / prepack-gentle-intro-1.md
Last active March 22, 2025 07:22
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@paneru-rajan
paneru-rajan / setup_server.md
Last active November 17, 2021 15:44
[Nginx, Php, PhpMyAdmin, MariaDB, Postgres, PhpPgAdmin Installation] Installation of nginx, php, phpmyadmin, phppdadmin, mysql and postgres in ubuntu 16.04 #public #loclhost #ubuntu #php #mariadb #installation #phppgadmin #phpmyadmin #postgres #nginx

Installation and Configuration

  1. Update System

    sudo apt install update && sudo apt upgrade -y
  2. Install Nginx

@BaReinhard
BaReinhard / Installing Wine (After Homebrew).md
Last active May 3, 2025 05:37
Installing Wine to run .exe files on Mac

Install Wine to run .exe files

For Mac OSX

If you haven't installed Homebrew yet do so by following this guide

  1. Open a terminal
  2. brew install --cask xquartz, wait for it to complete the install, it should ask you for your password before beginning
  3. brew install --cask wine-stable , this will take some time to finish so sit back and relax.

For Linux

  1. sudo apt-get install wine-stable
@Cyberek
Cyberek / README.txt
Last active September 9, 2021 00:17
Starting Kodi automatically on Raspbian Jessie and Stretch
So you were able to install Kodi via "sudo apt-get install kodi" but have no idea how to force it to autostart on boot?
You have tried all those googled solutions such as adding kodi-standalone to .bashrc, creating init.d script but nothing worked?
This is the right place to get the answer.
For some reason, the current version of Kodi doesnt provide 2 important files:
/etc/init.d/kodi
/etc/default/kodi
@yocontra
yocontra / aoe2hd.md
Last active June 9, 2023 18:28
Age of Empires II HD - For Mac OSX
@sadovnik
sadovnik / nvim-python-match-tag-always.md
Last active April 19, 2021 05:09
neovim nvim MatchTagAlways error fix

If you get this error when open neovim:

$ nvim

MatchTagAlways unavailable: requires python.
Press ENTER or type command to continue

Try to install neovim package:

@eljuguetero
eljuguetero / capture.py
Last active September 18, 2018 07:26
Python audio capture for Matrix
'''
* Copyright 2017 <[email protected]>
* MATRIX Labs [http://creator.matrix.one]
* This file is part of MATRIX Creator HAL
*
* This example is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful, but
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required