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 websocket | |
import json | |
import time | |
timer = '30000' | |
url = "ws://172.25.242.118/ws" | |
def on_message(ws, message): | |
obj = json.loads(message) | |
dev = obj['dev'] | |
circuit = obj['circuit'] |
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
app.directive("limitTo", [function() { | |
return { | |
restrict: "A", | |
link: function(scope, elem, attrs) { | |
var limit = parseInt(attrs.limitTo); | |
angular.element(elem).on("keydown", function(e) { | |
if (this.value.length == limit) e.preventDefault(); | |
}); | |
} | |
} |
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
usalo asi en php | |
header('Access-Control-Allow-Origin: *'); | |
header('Access-Control-Allow-Methods:GET, POST, OPTIONS'); | |
header('Access-Control-Allow-Headers: Content-Type, x-xsrf-token'); | |
$device=json_decode(file_get_contents('php://input')); //adquiere los datos que vienen como json |
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 datoaEnviar = "algo"; | |
$.ajax({ | |
type: "POST", | |
url: "script.php", | |
data:{ comosellamelavarible: datoaEnviar }, | |
success: function(data){ | |
console.log(data); | |
} | |
}) |
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 serial, time | |
ser = serial.Serial( | |
port='/dev/ttyUSB0', | |
baudrate=9600, | |
parity=serial.PARITY_EVEN, | |
stopbits=serial.STOPBITS_ONE, | |
bytesize=serial.SEVENBITS, | |
timeout=0.5 | |
) |
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
#!/bin/bash | |
echo --- Iniciando script de instalacion ---- | |
apt-get install apache2 php5 mysql-client mysql-server vsftpd perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python lsb-core | |
wget http://prdownloads.sourceforge.net/webadmin/webmin_1.760_all.deb | |
wget https://secure.logmein.com/labs/logmein-hamachi_2.1.0.139-1_armhf.deb | |
git clone https://github.com/UniPiTechnology/evok | |
echo ---- descargas terminadas---- | |
dpkg -i logmein-hamachi_2.1.0.139-1_armhf.deb |
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
#! /bin/bash | |
while true | |
do | |
cwd=$(pwd) | |
FILES=$cwd/src/**/**/* // renplace with your path | |
current=`date +%s` | |
for f in $FILES | |
do | |
last_modified=`stat -c %Y $f` | |
if [ $(($current-$last_modified)) -lt 2 ]; then |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Search con React</title> | |
<script src="build/react.js"></script> | |
<script src="build/react-dom.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script> | |
</head> | |
<body> |
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
fn main() { | |
println!("Hola, Mozilleros de EL salvador!!"); | |
} |
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
<script> | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
ga('create', 'UA-72197478-1', 'auto'); | |
ga('send', 'pageview'); | |
</script> |
NewerOlder