Skip to content

Instantly share code, notes, and snippets.


Zev Averbach zevaverbach

View GitHub Profile
mystal /
Created Dec 22, 2021
Print odd number arguments
use std::env;
fn main() {
let odds: Vec<_> = env::args()
.map(|s| s.parse::<i32>().unwrap())
.filter(|&n| n % 2 != 0)
println!("odd numbers: {:?}", odds);
View serverless.yaml
service: my-service
name: aws
region: ${opt:region, 'eu-west-1'}
stage: ${opt:stage, 'development'}
- serverless-s3-sync
Jack-Works / 2018.js
Last active Jan 22, 2023
cRAzY eSnEXt (*all* proposals mixed in)
View 2018.js
#! Aaaaaaaaaaa this is JS!!!
// This file is mixing all new syntaxes in the proposal in one file without considering syntax conflict or correct runtime semantics
// Enjoy!!!
// Created at Nov 23, 2018
for await(const x of (new A //
|> do { //
case(?) { //
when {val}: class {
Rich-Harris /
Last active Nov 3, 2022
Next-gen Node HTTP APIs

I saw this poll on Twitter earlier and was surprised at the result, which at the time of writing overwhelmingly favours option 1:

Screen Shot 2020-09-10 at 10 19 22 AM

I've always been of the opinion that the (req, res, next) => {} API is the worst of all possible worlds, so one of two things is happening:

  • I'm an idiot with bad opinions (very possibly!)
  • People like familiarity
from flask import Flask, send_from_directory
import random
app = Flask(__name__)
# Path for our main Svelte page
def base():
return send_from_directory('client/public', 'index.html')
jnothman /
Created May 30, 2019
datetime.fromisoformat backported from Python 3.7
"""datetime.fromisoformat backported from Python 3.7
1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
otherwise using this software ("Python") in source or binary form and
its associated documentation.
Rich-Harris /
Last active Dec 20, 2019
Source bytes: React vs Ember Octane vs Svelte

I'm procrastinating instead of working on a conference talk, so I decided to implement this component in Svelte to see which framework is most expressive:

Screen Shot 2019-03-30 at 16 42 16

Ember Octane

Here's the original, with the addition of an import for dataUriAsSrc (and updated per @chriskrycho's comment):

View requestMultiplexer.js
addEventListener("fetch", event => {
* Multiplex requests to a fixed list of destinations.
* It is intentional that we only support rewriting the incoming request URL to
* that of the destination. Everything else on the request is untouched.
virolea / upload.js
Last active Jan 17, 2023
Tracking file upload progress using axios
View upload.js
upload(files) {
const config = {
onUploadProgress: function(progressEvent) {
var percentCompleted = Math.round((progressEvent.loaded * 100) /
let data = new FormData()
data.append('file', files[0])
scarpent / better-twitter
Last active Sep 13, 2021
Better Twitter: Greasemonkey/Tampermonkey script to hide stuff you don't want to see
View better-twitter
// ==UserScript==
// @name Better Twitter
// @namespace
// @version 0.1
// @description Remove unwanted stuff (promoted, other people's likes, ...)
// @author Scott Carpenter
// @match
// @require
// @require
// @grant none