Skip to content

Instantly share code, notes, and snippets.

View dianjuar's full-sized avatar

Diego Julião dianjuar

  • Medellín - Colombia
  • 20:15 (UTC -05:00)
  • X @dianjuar
View GitHub Profile
@dianjuar
dianjuar / i3-shortcuts-screenshot.md
Last active April 24, 2024 15:10
My i3 shortcuts to take screenshots

Requirements

  • maim
  • xclip

Set-up

Set this on your i3 config file ~/.i3/config

# Screenshots
@dianjuar
dianjuar / android_on_arch.md
Created April 10, 2017 03:22
install android SDK on arch linix

Install Android SDK on Arch Linux

1. Download Android SDK on your computer

yaourt android-sdk-platform-tools
yaourt android-udev
yaourt android-sdk

2. Create global variables on system

@dianjuar
dianjuar / Install update WordPress puglins directly.md
Last active April 16, 2024 12:21
Install update WordPress plugins without providing ftp access

Install WordPress plugins directly (without FTP)

Put this on your wp-config.php

/* That's all, stop editing! Happy blogging. */
define('FS_METHOD', 'direct');
@dianjuar
dianjuar / Restore the GRUB Bootloader.md
Last active April 9, 2024 12:56
Restore the GRUB Bootloader on Manjaro Linux. Usefull when your fresh windows install eats your grub and can not boot into your linux installation, or for some how your grub is missing

Restore the GRUB Bootloader on Manjaro

  1. Chroot into your linux instalation
    1. The easiest way is with mhwd-chroot
      1. Install it yaourt -S mhwd-chroot
      2. Run it sudo mhwd-chroot
      3. DONE, you have chrooted into your linux installation (open a root console of your installed linux OS, is like just open a console with root access)
  2. Restore your GRUB
    1. Install a new GRUB bootloader with grub-install /dev/sda
  3. Recheck to ensure the that installation has completed without any errors grub-install --recheck /dev/sda
@dianjuar
dianjuar / create-months-folder.sh
Created October 22, 2023 18:38
Bash script to create moths of the year in Spanish
mkdir "01 Enero";
mkdir "02 Febrero";
mkdir "03 Marzo";
mkdir "04 Abril";
mkdir "05 Mayo";
mkdir "06 Junio";
mkdir "07 Julio";
mkdir "08 Agosto";
mkdir "09 Septiembre";
mkdir "10 Octubre";
@dianjuar
dianjuar / How to make a WordPress plugin require another plugin.md
Last active July 18, 2023 19:27
Make a WordPress plugin dependent of another plugin

How to make WordPress a plugin require another plugin?

Put this function on the main php file of your dependent plugin and call it with the rigth parameters.

/**
 * Verify if a plugin is active, if not deactivate the actual plugin an show an error
 * @param  [string]  $my_plugin_name
 *                   The plugin name trying to activate. The name of this plugin
 *                   Ex:
@dianjuar
dianjuar / interviewer-questions.md
Last active March 20, 2023 17:34
List for questions to make in an interview

Role

  • How did this position come to be open?
  • What would my immediate priorities be?
  • What is the performance review process like here?
  • What are the most important skills to have to do well in this job?
  • What is the typical career path for someone in this role?
  • What are the biggest challenges that someone in this position would face?
  • Can you show me examples of projects I would be working on?
  • How will my performance be reviewed? how often? what metrics will be used?
  • When and how is feedback given to me as an employee? (one to one, polls)
@dianjuar
dianjuar / spawn-async.ts
Created November 15, 2022 05:16
child_process.spawn using promises
import { spawn } from 'child_process';
export function spawnAsync(command: string, args?: string[]): Promise<void> {
return new Promise((resolve, reject) => {
const process = spawn(command, args);
process.stdout.on('data', data => {
console.log(data.toString());
});
process.stderr.on('data', data => {
@dianjuar
dianjuar / fileExists.ts
Created October 19, 2022 05:48
Node function to verify if a file exists
import { promisify } from 'util';
export async function fileExists(path: string): Promise<boolean> {
try {
await promisify(access)(path);
return true;
} catch (err) {
if (isAccessError(err) && err.code === 'ENOENT') {
return false;
}
@dianjuar
dianjuar / connecting-lines.directive.ts
Last active October 7, 2022 17:03
Create connecting lines between boxes with Angular
import {
AfterViewInit,
Directive,
ElementRef,
Inject,
Input,
} from '@angular/core';
import { DOCUMENT } from '@angular/common';
import { MapPathsDirective } from './map-path.directive';