Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Simone Basso bassosimone

🎯
Focusing
View GitHub Profile
View index.html
<!doctype html>
<html lang='en'>
<head><meta charset='utf-8'><title>ndt7</title></head>
<body><script type='text/javascript'>
/* jshint esversion: 6, asi: true */
console.log('creating the downloader')
let downloader = new Worker('ndt7-minimal.js')
downloader.postMessage({
url: window.location.href,
subtest: 'download',
View gist:a4d47b7264c07f72aaa6e11eb0ea5ff9
diff --git a/www/index.html b/www/index.html
index 1aafce9..648bcd8 100644
--- a/www/index.html
+++ b/www/index.html
@@ -32,6 +32,11 @@
/* exported Run */
/* globals libndt7 */
+ function MaybeHostname() {
+ const url = new URL(window.location.href)
@bassosimone
bassosimone / single-convenience-lib.diff
Last active Mar 15, 2018
Compile tor using libtool
View single-convenience-lib.diff
From bceafcbe1dce3af6707a7f02ade077860356d4a6 Mon Sep 17 00:00:00 2001
From: Simone Basso <bassosimone@gmail.com>
Date: Thu, 15 Mar 2018 11:26:03 +0100
Subject: [PATCH 2/2] build system: make single convenience library
---
.gitignore | 1 +
src/or/include.am | 13 +++++++++++++
2 files changed, 14 insertions(+)
View visual-cpp-templates.cpp
// make templates work in Visual Studio
// xref: https://github.com/measurement-kit/measurement-kit/pull/1536
#include <stdlib.h>
#include <time.h>
#include <iostream>
// experiment with several combinations of modifiers
#if 1
View map_noexcept.cpp
#include <map>
#include <string>
int main() {
std::map<std::string, std::string> map;
auto x = map.at("foo");
}
View untrusted-lvl13-solution.js
/*
* robotMaze.js
*
* The blue key is inside a labyrinth, and extracting
* it will not be easy.
*
* It's a good thing that you're a AI expert, or
* we would have to leave empty-handed.
*/
View threading.lua
mk_runtime = (function ()
local self = {}
self.coroutines = {}
self.async = function (func)
self.coroutines[coroutine.create(func)] = {
status = "running",
func = func
}
View relight_script_example.cpp
Var<Stream> stream(new Stream(poller));
poller->run([=](std::function<void(std::function<void()>)> stop) {
std::function<void()> cleanup = [=]() {
poller->break_loop();
stream->close();
};
stream->connect_ipv4("127.0.0.1", 8080, [=]() {
stream->on_data([=](Var<Bytes>) {
stream->on_flush([=]() {
stream->write("flushed\n");
View gist:683bdce621b85aadae84
#include <ight/common/pointer.hpp> // SharedPointer: a std::shared_ptr wrapper with null pointer checks
using namespace ight::common::pointer; // Allow you to use SharedPointer directly
// An abstract class and two implementations of it
struct AbstractAntani {
// API:
virtual void foo() = 0;
virtual std::string bar(double) = 0;
View libight.m
@interface GenericTest : NSObject
typedef void(^begin_function)(void);
typedef void(^end_function)(void);
+ (GenericTest *)make_test:NSDictionary;
- (void)begin:begin_function;
- (void)end:end_function;
///
You can’t perform that action at this time.