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
// -- blaster method-- | |
var url = location.href; | |
var MAX = 2000; | |
function at(count) { | |
var x = new XMLHttpRequest(); | |
x.open('GET', url); | |
x.send(); | |
console.log('Sent ' +(count+1) +' requests master!!'); | |
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
function plot() { | |
ctx.fillRect(0, 0, canvas.width, canvas.height); | |
// draw top line and find the points | |
set[0] = []; | |
set[1] = []; | |
ctx.beginPath(); | |
ctx.moveTo(p1[0], p1[1]); | |
drawPoint(p1[0], p1[1]); | |
var c = 0; | |
for(var t = 0; t <= 1; t += .001) { |
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 | |
/** | |
* @author Jay Taylor [@jtaylor] | |
* | |
* @date 2012-02-23 | |
* | |
* @description Originally found on SO: | |
* http://stackoverflow.com/questions/962915/how-do-i-make-an-asynchronous-get-request-in-php | |
*/ |
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 formObj = document.getElementById('form-loaded-via-ajax'); | |
// ^^ Use any form of method to get the DOM object here | |
formObj.addEventListener("submit", function(event) { | |
if (typeof event.target[CSRFP.CSRFP_TOKEN] === 'undefined') { | |
event.target.appendChild(CSRFP._getInputElt()); | |
} else { | |
//modify token to latest value | |
event.target[CSRFP.CSRFP_TOKEN].value = CSRFP._getAuthKey(); | |
} |
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
#include <CapacitiveSensor.h> | |
CapacitiveSensor c32 = CapacitiveSensor(3,2); | |
CapacitiveSensor c45 = CapacitiveSensor(4,5); | |
//CapacitiveSensor c1110 = CapacitiveSensor(11,10); | |
#define THRESHOLD 100 | |
#define o1 7 | |
#define o2 8 | |
#define FREQ 50 |
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 os | |
import sys | |
import time | |
import json | |
import inspect | |
import random | |
import string | |
def getRandStr(len): | |
return ''.join(random.SystemRandom().choice( |
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 | |
// ..... all other code --- | |
// Assuming database is connected | |
$k = $_POST['search_key']; | |
// Assuming $k is the search key | |
//include __DIR__ .'<path to lib.search.php>' | |
// i.e include the search library here | |
include __DIR__ .'/lib.search.php'; |
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 | |
include __DIR__ .'/libs/csrf/csrfprotector.php'; | |
csrfprotector::init(); | |
if (isset($_POST['field1'])) { | |
echo 'success'; | |
exit; | |
} | |
?> | |
<html> |
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 | |
$TMP = $argv[2]; | |
$no_of_files = intval($argv[1]); | |
function logln($m) { | |
global $TMP; | |
file_put_contents($TMP .'/logs', $m .PHP_EOL, FILE_APPEND); | |
} | |
logln("[sink] started with pid = " .getmypid()); |
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://cdn.socket.io/socket.io-1.3.7.js"></script> | |
<script src="./client/socket.notification.js"></script> | |
<script> | |
var n = new notification({url: 'http://127.0.0.1:8090'}); | |
n.bind({ | |
channel: 'test', | |
message: function(data) { | |
if (typeof data.hello != 'undefined') return; | |
document.body.innerHTML += ' <div> New Message: ' +JSON.stringify(data.data) +'</div>'; | |
} |
OlderNewer