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
const url = require('url') | |
module.exports = (request,domainName) => { | |
console.log(request.headers) | |
if (request.headers.referer) { | |
const parsedURL = url.parse(request.headers.referer) | |
return parsedURL.hostname === domainName || | |
parsedURL.hostname === '127.0.0.1' || | |
parsedURL.hostname === 'localhost' | |
} |
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
const http = require('http'), | |
url = require('url') | |
const PORT = 3939 | |
const allowedSources = [ | |
'::1', | |
'localhost', | |
/^127\.0\.0\.\d\d?\d?$/ | |
] |
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
#!/usr/bin/python | |
import os | |
import time | |
def checkConnection (): | |
return os.system("ping -c 1 google.com") == 0 | |
def connect(): | |
os.system("nmcli con up 'Movistar Default'") |
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 src="https://www.google.com/recaptcha/api.js?render=6LduhJcUAAAAAJ7L1bpfSKOIkzvnWOX4hPgNDNBO"></script> | |
<script> | |
grecaptcha.ready(function() { | |
grecaptcha.execute('6LduhJcUAAAAAJ7L1bpfSKOIkzvnWOX4hPgNDNBO', {action: 'form_validation'}).then(function(token) { | |
document.getElementById('g-recaptcha-response').value = token; | |
}); | |
}); | |
</script> |
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
<?php | |
function httpPost($url, $data){ | |
$curl = curl_init($url); | |
curl_setopt($curl, CURLOPT_POST, true); | |
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); | |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); | |
$response = curl_exec($curl); | |
curl_close($curl); | |
return $response; | |
} |
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
const fs = require('fs'), | |
{ promisify } = require('util'), | |
express = require('express') | |
const asyncStat = promisify(fs.stat) | |
var router = express.Router() | |
router.use(function(req, res, next){next()}) |
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 React from 'react' | |
const Slice = props => ( | |
<div className={props.current===props.index?'active':null}> | |
<label onClick={props.activate} >{props.index + 1}</label> | |
<div> | |
<section> | |
{props.children} | |
<br/> | |
<div className="acordeon-buttons"> |
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
curl -s https://api.github.com/repos/holochain/holochain-rust/releases/latest \ | |
| grep browser_download_url \ | |
| grep linux-x64 \ | |
| cut -d '"' -f 4 \ | |
| wget -qi - |
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
<pre> | |
<?php | |
$string = 'vrcec,wrcwercr,cref43e3d,c*&^U,efrwe'; | |
echo $string; | |
echo "<br>"; | |
$stuff = explode( ',' , $string ); | |
print_r($stuff); | |
foreach ($stuff as $key => $value){ | |
$cgars = str_split( $string ); |
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
library(neuralnet) | |
# creating training data set | |
TKS= c(20,10,30,20,80,30,90,99,99,40,12,32) | |
CSS= c(90,20,40,50,50,80,90,99,99,10,20,30) | |
Placed=c(1 ,0 ,0 ,0 ,1 ,1 ,1 ,1 ,1 ,0 ,0 ,0) | |
df=data.frame(TKS,CSS,Placed) | |
nn=neuralnet(Placed~TKS+CSS,data=df, hidden=3, act.fct = "logistic", linear.output = FALSE) |
OlderNewer