Skip to content

Instantly share code, notes, and snippets.

View dsalcedo's full-sized avatar
🐳
Backend

J. Daniel Salcedo Sambrano dsalcedo

🐳
Backend
  • Backapp
  • Mexico
View GitHub Profile
@dsalcedo
dsalcedo / encrypt_file_pkcs5_pkcs7.go
Created December 2, 2019 17:59 — forked from huyinghuan/encrypt_file_pkcs5_pkcs7.go
golang encrypt with pkcs5 and pkcs7
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"errors"
"io"
"io/ioutil"
@dsalcedo
dsalcedo / DOSpacesStorageServiceProvider.php
Created April 17, 2019 20:57 — forked from m2sh/DOSpacesStorageServiceProvider.php
How To Use Digitalocean Spaces as Laravel Cloud filesystems
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Aws\S3\S3Client;
use League\Flysystem\AwsS3v3\AwsS3Adapter;
use League\Flysystem\Filesystem;
use Storage;
@dsalcedo
dsalcedo / php.md
Last active April 8, 2019 16:41
TEST
Example::myTestingMethod('test');

// Should be return message Hello {argument_var} !

$test = new Testing;
$test->name('My name')->alias('my_alias')->create();

// Should be return 
@dsalcedo
dsalcedo / fintech_api_list.md
Created March 11, 2019 21:01 — forked from diegozr1/fintech_api_list.md
Curated list of Mexican API's with resources for fintech apps

Mexican Fintech APIs

This is a list of APIs you can use to build or power your app with fintech innovation in Mexico.

Bank Account information

@dsalcedo
dsalcedo / Envoy.blade.php.md
Created March 5, 2019 19:16 — forked from nasirkhan/Envoy.blade.php.md
Deploying with Envoy

SSH Keys

SSH keys provide a more secure way of logging into a virtual private server with SSH than using a password alone. While a password can eventually be cracked with a brute force attack, SSH keys are nearly impossible to decipher by brute force alone. Generating a key pair provides you with two long string of characters: a public and a private key. You can place the public key on any server, and then unlock it by connecting to it with a client that already has the private key. When the two match up, the system unlocks without the need for a password. You can increase security even more by protecting the private key with a passphrase.

https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2

Step One—Create the RSA Key Pair

The first step is to create the key pair on the client machine (there is a good chance that this will just be your computer):

@dsalcedo
dsalcedo / lambda-helloWorld.php
Created March 4, 2019 16:40 — forked from robinvdvleuten/lambda-helloWorld.php
Invoke sample Lambda function through PHP
<?php
require_once __DIR__.'/vendor/autoload.php';
use Aws\Lambda\LambdaClient;
$client = LambdaClient::factory([
'version' => 'latest',
// The region where you have created your Lambda
'region' => 'eu-west-1',
docker stop $(docker ps -aq)
docker rmi laradock_mysql --force
sudo rm -rf ~/.laradock/data
docker rmi mysql
docker rm laradock_mysql_1
docker-compose build --no-cache mysql
// browser detect
var BrowserDetect = {
init: function() {
this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version";
this.OS = this.searchString(this.dataOS) || "an unknown OS";
},
searchString: function(data) {
for (var i = 0; i < data.length; i++) {
var dataString = data[i].string;
package main
import (
"bufio"
"log"
"os"
)
var concurrency = 100

input: 9, [... [...], [...]]

where arr format is (sample): [ [1,2,3,4,5,6,7,8,9], [9,8,7,6,5,4,3,2,1], [9,8,7,6,5,6,7,8,9], [9,6,8,7,5,8,7,9,8], ]