This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Ejemplo: https://jsfiddle.net/mrroot5/Ldkmn2y5/ --> | |
<div class="container-fluid"> | |
<div class="row"> | |
<div class="d-flex justify-content-center align-items-center"> | |
<p>Con <strong>justify-content-center</strong> centramos horizontalmente. Mientras que con <strong>align-items-center</strong> centramos verticalemente.</p> | |
</div> | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
print(os.getcwd()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os.path, time, datetime | |
file_path = "path/to/file.txt" | |
string_date_format = "%a %b %d %H:%M:%S %Y" | |
# Get last modified | |
string_date = time.ctime(os.path.getmtime(file_path) | |
print(string_date) | |
# Convert last modified string to datetime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function titleCase(text) { | |
if (typeof text !== 'string') return '' | |
return text.charAt(0).toUpperCase() + text.slice(1).toLowerCase(); | |
} | |
var myString = "my awesomE String"; | |
titleCase(myString); | |
// My awesome string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tested on bootstrap 4 - 4.1 | |
function bs4Env() { | |
var envs = ['xs', 'sm', 'md', 'lg', 'xl'], | |
classToAdd = '', | |
$el = $('<div>'), | |
i = 0, | |
env; | |
$el.appendTo($('body')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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])] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FloatingBtn { | |
constructor(element=undefined, options={}) { | |
try { | |
if (typeof element === "undefined") { | |
throw "Error: HTML not found" | |
} | |
this.element = document.querySelector(element); | |
this.button = undefined; | |
this.options = options; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.snackbar { | |
visibility: hidden; | |
min-width: 100px; | |
/* Dividimos el min-width por 2 para el | |
centrar el elemento */ | |
margin-left: -50px; | |
border-radius: 5px; | |
position: fixed; | |
z-index: 10; | |
/* Centramos la snackbar en la pantalla */ |