Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Adrián G mrroot5

🏠
Working from home
Block or report user

Report or block mrroot5

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mrroot5
mrroot5 / validate_spanish_id.js
Created Mar 2, 2019 — forked from afgomez/validate_spanish_id.js
Spanish DNI, CIF, NIE validator
View validate_spanish_id.js
/**
* ValidateSpanishID. Returns the type of document and checks its validity.
*
* Usage:
* ValidateSpanishID( str );
*
* > ValidateSpanishID( '12345678Z' );
* // { type: 'dni', valid: true }
*
* > ValidateSpanishID( 'B83375575' );
View arrify.js
function arrify(val) {
return val == null ? [] : Array.isArray(val) ? val : [val];
}
@mrroot5
mrroot5 / AESCipher.py
Created Jun 5, 2018 — forked from swinton/AESCipher.py
Encrypt & Decrypt using PyCrypto AES 256 From http://stackoverflow.com/a/12525165/119849
View AESCipher.py
#!/usr/bin/env python
import base64
from Crypto import Random
from Crypto.Cipher import AES
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s : s[0:-ord(s[-1])]
View getnifs.py
#!/usr/bin/python
# Based on https://gist.github.com/provegard/1536682, which was
# Based on getifaddrs.py from pydlnadms [http://code.google.com/p/pydlnadms/].
# Only tested on Linux!
from socket import AF_INET, AF_INET6, inet_ntop
from ctypes import (
Structure, Union, POINTER,
pointer, get_errno, cast,
@mrroot5
mrroot5 / check_platform.py
Created May 25, 2018 — forked from zhreshold/check_platform.py
Check OS/Python/Cpu Info and Network connections
View check_platform.py
"""Diagnose script for checking OS/hardware/python/pip/mxnet/network.
The output of this script can be a very good hint to issue/problem.
"""
import platform, subprocess, sys, os
import socket, time
try:
from urllib.request import urlopen
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
@mrroot5
mrroot5 / tutorial-casperjs.md
Last active Jan 19, 2018 — forked from andrewslince/install casperjs (and phantomjs) on ubuntu
Tutorial casperjs instalación, configuración y tips
View tutorial-casperjs.md

CasperJS

CasperJS permite escribir test en JavaScript que se ejecutan en el navegador, permite testeo de navegadores headless o no según la librería empleada.

Podemos instalar CasperJS con PhantomJS o SlimerJS.

PhantomJS (no empleado actualmente)

Usa webkit mediante QtWebkit (v5.5 en el momento de escribir este README).

@mrroot5
mrroot5 / buttonsgrid.kv
Last active Mar 6, 2017 — forked from Kovak/main.py
Nesting Grid Layouts in Kivy
View buttonsgrid.kv
# buttonsgrid.kv
<VideoGrid>
cols: 1
rows: 1
Button:
text: 'Video'
<ButtonsGrid>:
cols: 3
rows: 5
Button:
@mrroot5
mrroot5 / telegram-installer.sh
Created Oct 29, 2016 — forked from jalcaldea/telegram-installer.sh
Small script that simplifies Telegram installation in ubuntu.
View telegram-installer.sh
#!/bin/bash
echo "============================================="
echo "== Telegram Script Installer v 0.1 =="
echo "== =="
echo "== by Jalcaldea =="
echo "============================================="
echo "Downloading necesary files..."
@mrroot5
mrroot5 / git_utils.md
Last active Oct 3, 2016 — forked from jelcaf/Operaciones-Git
Comando útiles para git.
View git_utils.md

Push

Listado completo

Reset

Listado completo

#############################################

Volver a un commit anterior, descartando los cambios

git reset --HARD $SHA1

@mrroot5
mrroot5 / css_resources.md
Last active Aug 29, 2015 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.
View css_resources.md

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

You can’t perform that action at this time.