Skip to content

Instantly share code, notes, and snippets.

View MarcosBL's full-sized avatar
:octocat:
Github Advocate

MarcosBL MarcosBL

:octocat:
Github Advocate
View GitHub Profile
@MarcosBL
MarcosBL / Instrucciones.md
Last active June 13, 2020 22:24
Hack rápido para generar un buscador client-side a partir de una cuenta de Google Drive

Instalación

Hay que poner el código de este index.php en una ruta accesible por el servidor web, que debe soportar php, obviamente. Si por ejemplo lo metemos en una carpetaa /var/www/html/drive debe ser accesible desde http://tu_dominio_o_ip/drive

Además, necesitaremos una versión bastante reciente de rclone, podemos descargarla de https://rclone.org/downloads/

Estas instrucciones son para Linux, pero cualquiera con manejo suelto en windows podrá hacerlo funcionar sin problema.

Configuración

@MarcosBL
MarcosBL / fuck.py
Created September 24, 2019 23:35
Fuck you deleting Telegram messages after minutes
# NO SIRVE DE NADA BORRAR TU HISTORIAL, seguirá en el canal 48 horas
# disponible para cualquiera que quiera recuperarlo :P
from telethon import TelegramClient, events, sync
from telethon.tl.types import InputChannel, PeerChannel
from telethon.tl.types import Channel
import time
api_id = 'XXXXXX'
api_hash = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
@MarcosBL
MarcosBL / wp-utd.sh
Created September 10, 2019 16:32
Keep Wordpress Up to Date
#!/bin/bash
#
# WP-UTD
# WordPress Up To Date 0.1, May 25 2012
# by Marcos BL; No license, feel free use it
#
# WP-UTD checks all your local WordPress installations are
# up-to-date and notifies you by email if a new version
# is available.
#
@MarcosBL
MarcosBL / php-artisan-bash-completion.md
Created April 3, 2019 01:05
Bash-only Laravel Artisan tab auto-complete

Add the provided code in ~/.bash_profile ( or similarly sourced file ) and you'll get artisan command tab completes on any project on your system:

_artisan()
{
    local arg="${COMP_LINE#php }"

    case "$arg" in
        artisan*)
 COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
@MarcosBL
MarcosBL / PHPExcel_Basics.md
Created January 29, 2019 06:37 — forked from r-sal/PHPExcel_Basics.md
PHPExcel Notes and code snippets

Basics

Creating a new PHPExcel Object.

    $this->PHPExcel = new PHPExcel();

Working with sheets

Creating a new sheet:

@MarcosBL
MarcosBL / index.html
Last active May 16, 2017 14:07
DomPDF page footers
<html>
<head>
<style>
p { page-break-after: always; }
.footer { position: fixed; bottom: 0px; }
.pagenum:before { content: counter(page); }
</style>
</head>
<body>
<div class="footer">Page: <span class="pagenum"></span></div>
@MarcosBL
MarcosBL / tabs2html.utils.php
Created March 4, 2017 00:25
Tabbed data from textarea conversion to array & nested html
<?php
class Utils
{
public static function tabs2array($list, $indentation = ' ') {
$result = array();
$path = array();
$list = str_replace("\r", "", $list);
foreach (explode("\n", $list) as $line) {
$depth = 0;
while (substr($line, 0, strlen($indentation)) === $indentation) {
@MarcosBL
MarcosBL / hosts.ps1
Created November 7, 2016 20:21 — forked from markembling/hosts.ps1
Powershell script for adding/removing/viewing entries to the hosts file.
#
# Powershell script for adding/removing/showing entries to the hosts file.
#
# Known limitations:
# - does not handle entries with comments afterwards ("<ip> <host> # comment")
#
$file = "C:\Windows\System32\drivers\etc\hosts"
function add-host([string]$filename, [string]$ip, [string]$hostname) {
@MarcosBL
MarcosBL / remove-crap.ps1
Created July 18, 2016 17:41
Remove Initial Crap from Windows 10
Get-AppxPackage *3dbuilder* | Remove-AppxPackage
Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage
Get-AppxPackage *officehub* | Remove-AppxPackage
Get-AppxPackage *skypeapp* | Remove-AppxPackage
Get-AppxPackage *getstarted* | Remove-AppxPackage
Get-AppxPackage *zunemusic* | Remove-AppxPackage
Get-AppxPackage *windowsmaps* | Remove-AppxPackage
Get-AppxPackage *solitairecollection* | Remove-AppxPackage
Get-AppxPackage *bingfinance* | Remove-AppxPackage
Get-AppxPackage *zunevideo* | Remove-AppxPackage
@MarcosBL
MarcosBL / Mercurial a Git.md
Created January 31, 2016 23:54
Convertir proyectos Mercurial (hg) a Git

Solo una vez, para instalar el conversor:

cd ~
git clone git://repo.or.cz/fast-export.git

Luego creamos un script hg2git para hacernos la vida más cómoda