Discover gists
/* Utilities */ | |
var RANDOM = function() {}; | |
function _randomInt(min, max) { | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} | |
function _randomHex(len) { | |
var hex = '0123456789abcdef'; |
(setq wl-copy-process nil) | |
(defun wl-copy (text) | |
(setq wl-copy-process (make-process :name "wl-copy" | |
:buffer nil | |
:command '("wl-copy" "-f" "-n") | |
:connection-type 'pipe)) | |
(process-send-string wl-copy-process text) | |
(process-send-eof wl-copy-process)) | |
(defun wl-paste () | |
(if (and wl-copy-process (process-live-p wl-copy-process)) |
""" | |
Streaming FFmpeg to HTTP, via Python's Flask. | |
This is an incredibly simple example, which will yield issues due to inconsistant input and output rates. | |
If you're going to use this, VLC works okay as a client. | |
You really need to move FFmpeg into a separate thread, which should help stream audio more consistantly to the HTTP client. | |
Example by Anthony Eden (https://mediarealm.com.au) | |
""" | |
from flask import Flask |
class AsyncMethodJob < ApplicationJob | |
queue_as :default | |
def perform(target:, method_name:, args:, queue_name: :default) | |
self.class.queue_as(queue_name) | |
# `target` could be either an instance or a class | |
target = target.constantize if target.is_a?(String) # Convert class name to class object if needed | |
target.send(method_name, *args) | |
end | |
end |
I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.
So below I made a list of leetcode problems that are as close to grokking problems as possible.
--- | |
version: "2.0" | |
services: | |
web: | |
image: ovrclk/e2e-test | |
expose: | |
- port: 8080 | |
as: 80 | |
to: | |
- global: true |
Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.
The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from