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
javascript: (function () { | |
var text = document.body.innerText; | |
var spl = text.split(" "); | |
if (spl.length > 3000) { | |
text = spl.slice(0, 3000).join(" "); | |
} | |
fetch('https://api.openai.com/v1/completions', { | |
method: 'POST', | |
headers: { |
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 | |
$scripts = []; | |
$scripts[] = 'ping google.com > google.txt'; | |
$scripts[] = 'ping msn.com > msn.txt'; | |
function spawn_scripts($scripts) { | |
$pids = []; | |
// iterate scripts, building list of indexed PIDs |
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 a_idx = 0; | |
$(document).on("click", function (e) { | |
var a = new Array("Click!". "Another Click!", "Add loads"); | |
var $i = $("<span/>").text(a[a_idx]); | |
a_idx = (a_idx + 1) % a.length; | |
var x = e.pageX, | |
y = e.pageY; | |
$i.css({ | |
"z-index": 999999999999, | |
"top": y - 20, |
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 | |
$ip = '192.168.2.113'; | |
// 192.168.2.114 | |
// 192.168.2.120 | |
$path = './'.$ip.'-stream-'.date('Y-m-d-H-i-s').'.xml'; | |
$url = 'http://'.$ip.'/clickit/analyticsdata.cgi?timeout=100000'; | |
do_capture($url, $path); |
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 | |
// 10 pixel per grid | |
define('IMAGE_WH', 25); // Pixels | |
define('SQUARE_RC', 5); // Columns/Rows | |
define('IMAGE_SQ_RATIO', IMAGE_WH / SQUARE_RC); //10 | |
function cellToCoords($cell) { | |
$x = (($cell - 1) % SQUARE_RC) + 1; | |
$y = ceil($cell / SQUARE_RC); |
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
<html> | |
<head> | |
<!-- Load the Paper.js library --> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/paper.js/0.11.5/paper-full.js"></script> | |
<!-- Define inlined PaperScript associate it with myCanvas --> | |
<script type="text/paperscript" canvas="myCanvas"> | |
var myPath = new Path(); | |
myPath.strokeColor = 'black'; |
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 | |
/* | |
* Plugin Name: WordPress.com Watermark Image Uploads | |
* Author: Alex Mills | |
* Author URI: http://automattic.com/ | |
*/ | |
class WPcom_Watermark_Uploads { | |
public $watermark; |
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 render_jsTable(jsTable) { | |
// build arbitrary HTML table from object | |
var html = []; | |
var table = $("<table>"); | |
var thead = $("<thead>").appendTo(table); | |
var tbody = $("<tbody>").appendTo(table); | |
if (jsTable.tableData.table) { | |
$.each(jsTable.tableData.table, function (key, val) { |
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 | |
//updated gist for additional array wrapping and empty children arrays (required) | |
$json = '[{ | |
"name": "Item 1", | |
"id": 0, | |
"children": [ | |
[] | |
] |
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 | |
$json = '[{ | |
"id": 8, | |
"text": 8, | |
"children": [{ | |
"id": 3, | |
"text": 3, | |
"children": [{ | |
"id": 1, | |
"text": 1, |
NewerOlder