Skip to content

Instantly share code, notes, and snippets.

View intelguasoft's full-sized avatar
👨‍🍳
Working from at Home...

Henry Díaz intelguasoft

👨‍🍳
Working from at Home...
View GitHub Profile
@intelguasoft
intelguasoft / php.ini
Created July 26, 2023 14:39 — forked from ShaneShipston/php.ini
NativePHP Windows Support
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@intelguasoft
intelguasoft / main.dart
Created November 3, 2022 15:33 — forked from CoderJava/main.dart
Flutter camera preview (full screen)
final mediaSize = MediaQuery.of(context).size;
final scale = 1 / (controller.value.aspectRatio * mediaSize.aspectRatio);
return ClipRect(
clipper: _MediaSizeClipper(mediaSize),
child: Transform.scale(
scale: scale,
alignment: Alignment.topCenter,
child: CameraPreview(controller),
),
);

youtube-dl

youtube-dl is an opensource command line tool to download video or audio from online video streaming services.

Videos downloaded in mkv or webm extensions can be played by VLC Media player in all major devices and operating systems including iPhone, Android devices.

Tool website: https://youtube-dl.org/

This gist shows the example commands to use the tool and doesn't support or encourage piracy or violation of copyrights of the online streaming service or the author of the content

Installing youtube-dl:

@intelguasoft
intelguasoft / Flutter ResponsiveDatatableSample.dart
Created April 26, 2022 17:09 — forked from naywin-programmer/Flutter ResponsiveDatatableSample.dart
To Create Responsive Datatable With Flutter Built-in Datatable
// Flutter Responsive Datatable
// Flutter Datatable Class: https://api.flutter.dev/flutter/material/DataTable-class.html
// Flutter code sample for DataTable
// This sample shows how to display a [DataTable] with three columns: name, age, and
// role. The columns are defined by three [DataColumn] objects. The table
// contains three rows of data for three example users, the data for which
// is defined by three [DataRow] objects.
//
@intelguasoft
intelguasoft / NumeroALetras.js
Created January 11, 2021 00:55 — forked from alfchee/NumeroALetras.js
Código en JavaScript que convierte números a letras, bastante útil para formularios de documentos contables y similares
/*************************************************************/
// NumeroALetras
// The MIT License (MIT)
//
// Copyright (c) 2015 Luis Alfredo Chee
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
@intelguasoft
intelguasoft / v2gif.sh
Created December 3, 2020 17:39 — forked from claudiodekker/v2gif.sh
Simple command to turn videos into GIFs
#!/bin/bash
v2gif() {
# Based on https://engineering.giphy.com/how-to-make-gifs-with-ffmpeg/
ffmpeg=""
filter=""
palettegen="palettegen"
paletteuse="paletteuse"
while getopts "w:f:is:t:" opt; do
@intelguasoft
intelguasoft / generateIntegerRandom.md
Created July 27, 2020 05:32
Para cualquier persona curiosa, esto muestra una distribución uniforme, y los límites son inclusivos

For anyone curious, this samples a uniform distribution, and the bounds are inclusive:

Para cualquier persona curiosa, esto muestra una distribución uniforme, y los límites son inclusivos:

let counts = {};
for (let i = 0; i < 100000; i++) {
  let c = randomInt(0, 4);
  counts[c] = (counts[c] == null ? 0 : counts[c]) + 1;
}
@intelguasoft
intelguasoft / randomInt.ts
Created July 27, 2020 05:30
Random Integer generator (Typescript)
/**
* Generates a random integer between min and max (inclusive)
* @param {number} min
* @param {number} max
* @returns randomly generated integer
*/
public randomInt = (min: number, max: number): number => {
return Math.floor(Math.random() * (max - min + 1) + min);
};

In order to connect remotely you have to have MySQL bind port 3306 to your machine's IP address in my.cnf. Then you have to have created the user in both localhost and '%' wildcard and grant permissions on all DB's as such . See below:

my.cnf (my.ini on windows)

#Replace xxx with your IP Address bind-address = xxx.xxx.xxx.xxx then

CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypass'; CREATE USER 'myuser'@'%' IDENTIFIED BY 'mypass';

@intelguasoft
intelguasoft / issue_pass_mysql_8.*.md
Created July 7, 2020 06:23
Clavos con la autenticación hacia mysql 8 desde otros clientes.

Execute the following query in MYSQL Workbench

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'

Where root as your user localhost as your URL and password as your password

Then run this query to refresh privileges:

flush privileges;