Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Pedro Rojas Reyes Sirpyerre

🏠
Working from home
View GitHub Profile
@Sirpyerre
Sirpyerre / copyImagesToBlog.go
Created Dec 9, 2020
Script in Go. This script copy from source file path to new destionation.
View copyImagesToBlog.go
package main
import (
"fmt"
"io"
"io/ioutil"
"log"
"net/url"
"os"
"path/filepath"
View server_side_process_mondodb.php
<?php
set_time_limit(0);
ini_set('memory_limit', '-1');
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
date_default_timezone_set('America/Mexico_City');
/**
* data to modify for it to work
View mongodb.html
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html" />
<title>DataTables mongoDB</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css">
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
</head>
@Sirpyerre
Sirpyerre / vhost laravel
Created Feb 12, 2019
Basic Virtual Host Laravel
View vhost laravel
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
@Sirpyerre
Sirpyerre / dd.php
Last active Nov 14, 2017
Una función para debuguear el contenido de una variable
View dd.php
<?php
function dd( $array = array(),$message = '', $exit = true)
{
$trace = debug_backtrace();
$file = isset($trace[0]['file']) ? $trace[0]['file'] : 'Unknow';
$line = isset($trace[0]['line']) ? $trace[0]['line'] : 'Unknow';
$class = isset($trace[1]['class']) ? $trace[1]['class'] : '';
$function = isset($trace[1]['function']) ? $trace[1]['function'] : '';
@Sirpyerre
Sirpyerre / typescript.sublime-build
Created Jun 21, 2017
TypeScript build-system for SublimeText 3
View typescript.sublime-build
{
"cmd": ["tsc", "$file"],
"file_regex": "(.*\\.ts?)\\s\\(([0-9]+)\\,([0-9]+)\\)\\:\\s(...*?)$",
"selector": "source.ts",
"windows": {
"cmd": ["tsc.cmd", "$file"]
}
}
View modules monoforms d8
composer create-project drupal-composer/drupal-project:8.x-dev drupal8 --stability dev --no-interaction
curl https://drupalconsole.com/installer -L -o drupal.phar mv drupal.phar /usr/local/bin/drupal chmod +x /usr/local/bin/drupal
drupal site:install
#para instalar las dependecias de drupal y los vendor
composer install --optimize-autoloader
composer require drupal/token
composer require drupal/adsense
composer require drupal/pathauto
@Sirpyerre
Sirpyerre / gist:9060904f2c1d78f88e938490d5d55d21
Last active Mar 23, 2017
Instalar Bitbucket Server en Centos 7
View gist:9060904f2c1d78f88e938490d5d55d21
Bajar de https://bitbucket.org/product/download
# chmod +x atlassian-bitbucket-4.14.0-x64.bin
#./atlassian-bitbucket-4.14.0-x64.bin
[/var/atlassian/application-data/bitbucket] [enter]
Dejar puertos default