Skip to content

Instantly share code, notes, and snippets.

View dariodiaz's full-sized avatar

Dario Diaz dariodiaz

View GitHub Profile
@dariodiaz
dariodiaz / decrypt_dbeaver.py
Created June 4, 2021 18:37 — forked from felipou/decrypt_dbeaver.py
DBeaver password decryption script - for newer versions of DBeaver
# https://stackoverflow.com/questions/39928401/recover-db-password-stored-in-my-dbeaver-connection
# requires pycryptodome lib (pip install pycryptodome)
import sys
import base64
import os
import json
from Crypto.Cipher import AES
@dariodiaz
dariodiaz / delete-remote-git.sh
Created April 14, 2021 22:23
[Delete Files from remote git repository] #git
# Remove a single file
git rm --cached password.txt
# Remove a single folder
git rm --cached -rf .idea
@dariodiaz
dariodiaz / reverse-string.js
Created April 5, 2021 14:51
[Reverse String] Leetcode challenge - Reverse String #leetcode #javascript #codinginterview
var reverseString = function(s) {
let left = 0; let right = s.length - 1;
while (left < right) {
let tmp = s[left];
s[left++] = s[right];
s[right--] = tmp;
}
return s;
};
@dariodiaz
dariodiaz / reverse-vowels.js
Last active April 5, 2021 16:13
[Reverse vowels] Leetcode challenge - Reverse vowels #leetcode #javascript #codinginterview
var reverseVowels = function (s) {
const arr = s.split("");
let left = 0, right = arr.length;
const vowels = ['A', 'E', 'I', 'O', 'U', 'a', 'e', 'i', 'o', 'u'];
while (left < right) {
if (vowels.indexOf(arr[left]) === -1) {
left++;
@dariodiaz
dariodiaz / wordpress_notes.txt
Created February 10, 2021 21:19
[Wordpress install] with blog and contact form
# To install Wordpress on a server
https://websiteforstudents.com/setup-apache2-virtualhost-multiple-wordpress-blogs/
# To add new elements to the top menu bar
https://www.wpbeginner.com/beginners-guide/how-to-add-navigation-menu-in-wordpress-beginners-guide/
# To add a contact form
https://www.wpbeginner.com/beginners-guide/how-to-create-a-contact-form-in-wordpress/
# To setup the notifications and SMTP configuration
@dariodiaz
dariodiaz / belongs-to-many.sublime-snippet
Created March 22, 2016 20:08 — forked from adamwathan/belongs-to-many.sublime-snippet
Eloquent Relationship snippets for Sublime Text
<snippet>
<content><![CDATA[
public function ${1:relationship}()
{
return \$this->belongsToMany(${1/^(.+)$/(?1\u$1:)/g}::class, {$2:table});
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>belt</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
@dariodiaz
dariodiaz / powerline-shell-install.md
Created September 10, 2015 00:09 — forked from tos-kamiya/powerline-shell-install.md
Config: Powerline-shell install
@dariodiaz
dariodiaz / WebDesignContract.md
Created May 12, 2015 14:30 — forked from pjrvs/WebDesignContract.md
freelance: sample web design contract

Web Design Contract (open-source)

Between [your name] and [their name]

Summary:

You ([their name]), located at [customer address] are hiring me ([your name]) located at [company address] to [design and develop a web site] for the estimated total price of [total] as outlined in our previous correspondence.

What do both parties agree to do?

@dariodiaz
dariodiaz / deploy.php
Last active August 29, 2015 14:19 — forked from krisnoble/deploy.php
<?php
date_default_timezone_set('Europe/London'); // Set this to your local timezone - http://www.php.net/manual/en/timezones.php
/**
* The root directory where the repos live.
*
* @var string
*/
$root_dir = '/your/root/dir/';

###Edit this file

/etc/nginx/nginx.conf

###Add this line anywhere inside the http { } block:

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

###Go to your Forge panel and restart Nginx