- C.H.I.P. $9 computer - $9 getchip.com/pages/chip
- HDMI Adapter - $15 getchip.com/pages/store
- Micro USB Power Supply 5V 2.5A (one with On/Off Switch is convenient) - $8 amzn.to/2jyWygU
- HDMI Cable - $6 amzn.to/2kDnqtN
- USB 2.0 A-Male to Micro B Cable - $6 amzn.to/2kDqKoN
- Paperclip or Male/Male Jumper wire - free or $7 amzn.to/2kDbiZE
This file contains 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
fallocate -l 4G /swapfile | |
chmod 600 /swapfile | |
mkswap /swapfile | |
swapon /swapfile | |
echo "/swapfile none swap sw 0 0" >> /etc/fstab |
This file contains 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
var xhttp; | |
if (window.XMLHttpRequest) { | |
xhttp = new XMLHttpRequest(); | |
} else { | |
// code for IE6, IE5 | |
xhttp = new ActiveXObject("Microsoft.XMLHTTP"); | |
} |
This file contains 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
form = MyFormForm(request.POST) | |
if form.is_valid(): | |
obj = form.save(commit=false) | |
obj.created_by = request.user | |
obj.save() |
This file contains 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
# remove double quote from json from a dict | |
import json, re | |
data = {'example': 1, "other" : {'other_key': "String", 'key_b': False}} | |
config = json.dumps(data) | |
vars = re.sub(r'"([a-zA-Z_]+)":', r'\1:', config) | |
print(vars) |
This file contains 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 para el utilizar el API Clickfono usando Node.js | |
*/ | |
var request = require('request'); | |
urlAPI = 'https://clickandtalk.medularis.com/calls/manage/api'; | |
/* |
This file contains 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 datetime | |
a1 = datetime.datetime.now() | |
import re | |
import os | |
a2 =datetime.datetime.now() | |
print(a1, a2, a2 - a1) | |
This file contains 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
def in_range_time_from_db(from, to, value=Time.now) | |
# The `time` types are storage in the database in format HH:MM:SS. | |
# `ActiveRecord` returns into theTime type '2000-01-01 HH:MM:SS' | |
# This function return these times [`from`, `to`] to present date | |
# and checks if the `value` is in this range period | |
from = from.to_time.strftime("%T") | |
to = to.to_time.strftime("%T") | |
from = Time.parse(from) |
This file contains 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
echo " <li class='nav-item dropdown '> | |
<a class='nav-link' href='/qpanel/login_external?domain_name=".$_SESSION['domain_name']."&domain_uuid=".$_SESSION['domain_uuid']."&username=".$_SESSION['username']."&user_uuid=".$_SESSION['user_uuid']."' > | |
<span class='fas fas fa-chart-pie' title='QPanel'></span> | |
<span class='d-sm-none d-md-none d-lg-inline' style='margin-left: 5px;'>QPanel</span> | |
</a> | |
</li>"; |
OlderNewer