Skip to content

Instantly share code, notes, and snippets.

Leszek Swirski LeszekSwirski

Block or report user

Report or block LeszekSwirski

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am LeszekSwirski on github.
  • I am leszek (https://keybase.io/leszek) on keybase.
  • I have a public key whose fingerprint is 8D0F A0C7 EA5D E958 7DC0 5C99 009D 7286 D20B 319A

To claim this, I am signing this object:

View cppargparse-proof-of-concept
#include <iostream>
#include <string>
#include <vector>
#include <memory>
#include <sstream>
#include <cassert>
struct ArgumentBase {
explicit ArgumentBase(std::string name) : name(std::move(name)), is_set(false), _has_default(false), _has_implicit(false), _use_implicit(false) {
}
@LeszekSwirski
LeszekSwirski / pinknoise.ipynb
Last active Aug 29, 2015
Create pink noise
View pinknoise.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View oneoverfsim.py
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import mlab
def one_over_f(f, knee, alpha):
desc = np.ones_like(f)
desc[f<KNEE] = np.abs((f[f<KNEE]/KNEE)**(-alpha))
desc[0] = 1
return desc
View via-ssh.sh
#!/bin/sh
########################################################################
#
# Usage: via-ssh.sh [-v] [-d] [USER@]SERVER[:PORT]
#
# -v Provide verbose output.
# -d Send all UDP on the DNS port 53 to 127.0.0.1.
# USER User name to use for SSH; default is current user.
# SERVER Server to use for SSH.
@LeszekSwirski
LeszekSwirski / inout.cpp
Last active Apr 14, 2017
C++ out/inout parameters
View inout.cpp
#include <algorithm>
template <typename T>
class out_ {
public:
explicit out_(T& val) : pval(&val) {}
explicit out_() : pval(nullptr) {}
void operator=(const T& newval) {
if (pval) {
You can’t perform that action at this time.