Skip to content

Instantly share code, notes, and snippets.

View diligasi's full-sized avatar
🚀
Always learning...

Diogo de Lima Gama da Silva diligasi

🚀
Always learning...
View GitHub Profile
@diligasi
diligasi / Windows Icon Files
Created May 5, 2017 02:40
Native Windows icon repository files
C:\Windows\Explorer.Exe
C:\Windows\System32\AccessibilityCpl.Dll
C:\Windows\System32\compstui.dll
C:\Windows\System32\Ddores.Dll
C:\Windows\System32\DDORes.dll
C:\Windows\System32\GameUx.Dll
C:\Windows\System32\imageres.dll
C:\Windows\System32\mmcndmgr.dll
C:\Windows\System32\mmRes.Dll
C:\Windows\System32\MorIcons.Dll
@diligasi
diligasi / setup.sh
Created May 5, 2017 03:47
This file contains the initial settings of a Vagrant machine with Ubuntu. In this file there are instructions for system upgrade and also the installation and configuration of Git, RVM, Ruby, Rails, MySQL and OH-MY-ZSH, the latter is a tool to improve the usability of Git in the terminal.
RUBY_VERSION="2.4.0" # You can change for any version you like
RAILS_VERSION="5.0.2" # You can change for any version you like
MYSQL_PASSWORD="XXXXX" # Remember to change for your own password
GIT_USER_NAME="XXXXX XXXXX" # Remember to change for your own user name
GIT_USER_EMAIL="[email protected]" # Remember to change for your own git email
NODE_VERSION="6" # You can change for any version you like
echo
@diligasi
diligasi / stackoverflowErrorCatcher.js
Last active July 7, 2017 15:40
If anything goes wrong catch error and stackoverflow comes to help!!! =-)
function stackoverflowErrorCatcher() {
try {
// Try something here, if anything goes wrong
// stackoverflow comes to help!!! =-)
} catch(e) {
console.log("# Caught Error ============================================");
console.log(e.stack);
console.log("===========================================================");
window.open("http://stackoverflow.com/search?q=[js] + " + e.message, "_blank");
}
@diligasi
diligasi / checkMobile.js
Created October 5, 2017 18:54
Uses JavaScript to check if the device accessing the system is mobile one and, if so, which OS (Android, IOS, etc ...)
const isMobile = {
getUserAgent: function() {
return navigator.userAgent;
},
Android: function() {
return /Android/i.test(isMobile.getUserAgent()) && !isMobile.Windows();
},
BlackBerry: function() {
return /BlackBerry|BB10|PlayBook/i.test(isMobile.getUserAgent());;
},
@diligasi
diligasi / uru
Created January 28, 2018 21:18
Make uru multi-platform command working on git bash
#!/bin/bash
# Created by Diligasi
export URU_INVOKER='batch';
uru_rt.exe "$1";
if [ "x$URU_HOME" == "x" ]; then
if hash "$USERPROFILE\.uru\uru_lackee.bat"; then cmd "/C $USERPROFILE\.uru\uru_lackee.bat"; fi
@diligasi
diligasi / README.txt
Created April 10, 2018 21:54
Installing path for Intellij on LInux Mint
# Path for start menu shortcut files
/usr/share/applications
# Path where to extract and install the Intellij IDE
/opt/
# For example the path above with bin folder
/opt/idea-IU-181.4203.550/bin
@diligasi
diligasi / Helpful
Last active February 6, 2019 21:41
=> WSL Dev Env
- https://medium.com/short-stories-on-software/surprisingly-software-development-on-windows-is-awesome-now-82251d66991a
- https://medium.com/koaandco/rails-5-postgresql-on-wsl-9b1315ac0679
- https://nickjanetakis.com/blog/using-wsl-and-mobaxterm-to-create-a-linux-dev-environment-on-windows
- *** https://nickjanetakis.com/blog/a-linux-dev-environment-on-windows-with-wsl-docker-tmux-and-vscode
=> Intellij
- https://intellij-support.jetbrains.com/hc/en-us/community/posts/207698489-How-can-you-use-new-Bash-on-Ubuntu-on-Windows-terminal-in-Webstorm-
- https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000232124-What-is-the-best-way-of-integrating-Webstorm-and-WSL-Bash-on-Windows-Creators-Update-Ubuntu-16-04-
=> Release Plan
@diligasi
diligasi / tmux.md
Created February 7, 2019 17:06
A guide for install and/or update tmux on Ubuntu and similar distros

Prepare system for new installation

# Before start, make sure you've killed all old tmux servers that
# could be still running in the background
sudo killall -9 tmux

# Remove any previous installation
sudo apt-get -y remove tmux

Install needed dependences

@diligasi
diligasi / .tmux.conf
Created March 10, 2019 22:14
My awesome tmux config
# -----------------------------------------------------------------------------
# This config is targeted for tmux 2.1+ and should be placed in ~/.tmux.conf
# Read the "Plugin Manager" section (bottom) before trying to use this config!
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# Change the default prefix key from CTRL+b to CTRL+a
# -----------------------------------------------------------------------------
set -g prefix C-a
bind C-a send-prefix
@diligasi
diligasi / reset_pk_sequence!
Created March 18, 2019 14:16
Reset table sequences to it's max value
ActiveRecord::Base.connection.tables.each do |table_name|
ActiveRecord::Base.connection.reset_pk_sequence!(table_name)
end