Skip to content

Instantly share code, notes, and snippets.

View gbelot2003's full-sized avatar
🎃
Working

Gerardo Belot gbelot2003

🎃
Working
View GitHub Profile
@gbelot2003
gbelot2003 / init.sh
Created February 23, 2023 06:59
simple sh to init typescript and nodejs with jest
#!/bin/bash
npm init -y
mkdir src
mkdir test
#git clone https://gist.github.com/f69ac30736183bafeb56903b818d9f78.git docker
npm i typescript
npm i -D jest
@gbelot2003
gbelot2003 / ssh
Created August 8, 2020 03:29
configuracion vsftpd ubuntu
listen=YES
listen_ipv6=NO
write_enable=YES
local_umask=022
chroot_local_user=YES
seccomp_sandbox=NO
allow_writeable_chroot=YES
userlist_enable=YES
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO
@gbelot2003
gbelot2003 / WordController.php
Created March 9, 2020 15:38
Ejemplo de usuo de PHPWord con y sin plantillas
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class WordController extends Controller
{
/**
* Generamos un archivo de word
@gbelot2003
gbelot2003 / docker-compose.yaml
Last active November 30, 2019 05:09
compose for wordpress
version: "3.0"
services:
# Database
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
@gbelot2003
gbelot2003 / sh
Created August 18, 2019 22:54
extraer filas filtradas de un cvs
#!/bin/bash
ruta="/home/gerardo/Descargas/xvideos"
ruta2="/home/gerardo/Descargas/limpias"
read -p "Enter Your File Number: " fileNumber
grep "teen" < $ruta"/"xvideo_part"$fileNumber" | grep "creampie" > $ruta2"/creampie."$fileNumber
@gbelot2003
gbelot2003 / php
Created August 10, 2019 19:19
ExamenesPostTest.php
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
class ExamenesPostTest extends TestCase
{
@gbelot2003
gbelot2003 / javascript
Created July 22, 2019 17:06
Funcion de envio de post acada x tiempo
(function schedule() {
background.asyncStuff().then(function() {
console.log('Process finished, waiting 5 minutes');
setTimeout(function() {
console.log('hacer post cada 5 minutos');
this.post("/url/para/ejecutar/logs")
}, 1000 * 60 * 5);
}).catch(err => console.error('error in scheduler', err));
})();
@gbelot2003
gbelot2003 / gist:abcfa74fa77cace00f1610093dbc642c
Created February 19, 2019 23:51
fix laradock mysql connection
This issue still exists, but I don't know if this is PMA or something else, anyway as workaround:
```
$ docker-compose exec mysql bash
$ mysql -u root -p
```
You should be able to login as 'root' or your other password.
Execute the following commands:
@gbelot2003
gbelot2003 / StateTest.spec.js
Created August 14, 2018 18:11
Testing Vuex getters from component
import Vuex from 'vuex'
import { shallow, createLocalVue } from 'vue-test-utils'
import State from './State.vue'
const localVue = createLocalVue()
localVue.use(Vuex)
describe('State', () => {
it('renders a value from $store.state', () => {
const wrapper = shallow(State, {
mocks: {
$store: {
@gbelot2003
gbelot2003 / MusicContext.cs
Created January 15, 2018 03:53
Code Fists EF context and models one to many
using System.Data.Entity;
namespace WebMigrationTest.Models
{
public class Album
{
[Key] public int AlmbumId { get; set; }
[Required()]