Before Github supported SSL encryption for github pages sites, many people were using CloudFlare (CF) as their DNS provider and CDN proxy. CF allowed users to enable SSL encryption from the CDN end points/proxies to the end user. This was great and it allowed visitors to your website to connect with a secure connection between their browser and the cloudflare CDN box that was serving your content. However, with this setup one (significant) link in the chain remained unencrypted and
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
| ;;; | |
| ;;; Copyright (C), zznop, brandonkmiller@protonmail.com | |
| ;;; | |
| ;;; This software may be modified and distributed under the terms | |
| ;;; of the MIT license. See the LICENSE file for details. | |
| ;;; | |
| ;;; DESCRIPTION | |
| ;;; | |
| ;;; This PoC shellcode is meant to be compiled as a blob and prepended to a ELF |
| # This example using | |
| # Nim: 0.18.0 | |
| # Jester: 0.2.1 | |
| # Using Jester >= 0.3.0 is preferrable if your Nim version > 0.18.0 | |
| # In case you're using Jester >= 0.3.0, look the syntax different | |
| # in its example because it's not backward compatible | |
| import db_sqlite, asyncdispatch, json, strformat, strutils, sequtils | |
| import jester |
This document describes a simple contract in pseudocode and gives a couple of test cases for it.
The challenge is designed to be fairly easy to implement in a language of choice, compiled to wasm and interacted with. It is loosely based on the ERC20 token standard, named "WRC20", where the W stands for WebAssembly.
The contract has two features:
| /* | |
| Copyright (C) 2018 Rich Talbot-Watkins | |
| This file is part of VirtualBeeb. | |
| VirtualBeeb is free software: you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by | |
| the Free Software Foundation, either version 3 of the License, or | |
| (at your option) any later version. |
| """ | |
| nim_magic.py | |
| Jupyter cell magic for your favorite programming language. | |
| This is now also available as a proper repo: | |
| https://github.com/apahl/nim_magic | |
| All further changes will be tracked there. | |
| Requirements: Nim (https://nim-lang.org), nimpy (`nimble install nimpy`, thanks to @yglukhov for this great library!) |
The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).
My take-aways are:
-
You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.
-
Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse
| import asyncdispatch | |
| import asynctools | |
| import docopt | |
| import json | |
| import nre | |
| import os | |
| import ospaths | |
| import sequtils | |
| import sha256/sha256sum | |
| import strutils |
| import macros | |
| macro lc(init, body): untyped = | |
| # analyse the body, find the deepest expression 'it' and replace it via | |
| # 'result.add it' | |
| let res = genSym(nskVar, "lcResult") | |
| proc detectForLoopVar(n: NimNode): NimNode = | |
| if n.kind == nnkForStmt: | |
| result = n[0] |