Skip to content

Instantly share code, notes, and snippets.

View bcoe's full-sized avatar
💭
hackin'

Benjamin E. Coe bcoe

💭
hackin'
View GitHub Profile
import thread, time
import socket
from hackwars.orbited_server.comet import handle_request
from orbited import start
def listen():
try:
comet_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
comet_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
@bcoe
bcoe / xunit.xml
Last active May 30, 2020 00:45
xunit.xml
<testsuite name="Mocha Tests" tests="640" failures="0" errors="2" skipped="0" timestamp="Sat, 30 May 2020 00:28:04 GMT" time="7.529">
<testcase classname="" name="should expose yargs-parser as Parser" time="0"/>
<testcase classname="Argsert" name="does not warn if optional argument is not provided" time="0.002"/>
<testcase classname="Argsert" name="warn if wrong type is provided for optional argument" time="0.002"/>
<testcase classname="Argsert" name="does not warn if optional argument is valid" time="0.001"/>
<testcase classname="Argsert" name="warns if required argument is not provided" time="0.002"/>
<testcase classname="Argsert" name="warns if required argument is of wrong type" time="0.001"/>
<testcase classname="Argsert" name="supports a combination of required and optional arguments" time="0.001"/>
<testcase classname="Argsert" name="warns if too many arguments are provided" time="0.001"/>
<testcase classname="Argsert" name="warn with argument position if wrong type is provided for argument" time="0.00
@bcoe
bcoe / test-output.tap
Created May 29, 2020 23:32
test-output.tap
TAP version 13
1..169
ok 1 parallel/test-fs-access
---
duration_ms: 0.87
...
ok 2 parallel/test-fs-append-file
---
duration_ms: 0.86
...
@bcoe
bcoe / node.xml
Created March 31, 2020 04:21
node.xml
<?xml version="1.0"?>
<testsuites>
<testsuite tests="2833" skipped="34" failures="1" errors="0" name="Default">
<testcase name="#1 parallel/test-accessor-properties"/>
<testcase name="#2 parallel/test-arm-math-illegal-instruction"/>
<testcase name="#3 parallel/test-assert"/>
<testcase name="#4 parallel/test-assert-async"/>
<testcase name="#5 parallel/test-assert-builtins-not-read-from-filesystem"/>
<testcase name="#6 parallel/test-assert-checktag"/>
<testcase name="#7 parallel/test-assert-deep"/>
@bcoe
bcoe / server.py
Created November 13, 2011 20:49
server.py
import asyncore
from secure_smtpd import SMTPServer, FakeCredentialValidator
class SSLSMTPServer(SMTPServer):
def __init__(self):
pass
def process_message(self, peer, mailfrom, rcpttos, message_data):
print message_data
@bcoe
bcoe / optional-chaining-productions.md
Last active November 18, 2019 04:52
optional-chaining-productions.md

Statement List

  • UpdateExpression[Yield, Await]

      • OptionalExpression[Yield, Await]
        • MemberExpression[Yield, Await] (member-expression.js)
          • PrimaryExpression[?Yield, ?Await]
            • this
            • IdentifierReference[?Yield, ?Await]
              • Identifier
    • Literal
@bcoe
bcoe / example.md
Created September 27, 2019 23:51
example.md

if:

  let threw = true;
  try {
    module.load(filename);
    threw = false;
  } catch (err) {
    rekeySourceMap(Module._cache[filename], err);
 throw err;
@bcoe
bcoe / source-map-example.md
Last active September 12, 2019 21:27
Source Map Support in Node.js

Programatic Access of Source Maps

To begin collecting source-maps, node must be run with --enable-source-maps (or with NODE_V8_COVERAGE set).

At which point, the new built-in module source_map can be used to interact with the source-map cache:

// tooling has one interface into the source-map cache, URIs, any type of module that we
// wish to attach source-maps to (ESM, CJS, evals, data-urls) needs to have a methodlogy
// for setting a URI; Two different source-maps cannot be stored at the same URI.
@bcoe
bcoe / upload.js
Created September 1, 2012 22:57
upload.js
var xhr = _this = this,
new XMLHttpRequest(),
fd = new FormData(),
key = this.email + '/' + epoch.toString() + '/' + file.name;
// Populate the Post paramters.
fd.append('key', key);
fd.append('AWSAccessKeyId', 'XXXXXXXXXXXX');
fd.append('acl', 'private');
fd.append('success_action_redirect', "https://attachments.me/upload_callback")
@bcoe
bcoe / commits.graphql
Created May 28, 2019 01:28
commits.graphql
query lastCommits($cursor: String, $owner: String!, $repo: String!, $perPage: Int, $maxFilesChanged: Int) {
repository(owner: $owner, name: $repo) {
defaultBranchRef {
target {
... on Commit {
history(first: $perPage, after: $cursor) {
edges{
node {
... on Commit {
message