Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');| #!/usr/bin/env python | |
| # Implementation of algorithm from http://stackoverflow.com/a/22640362/6029703 | |
| import numpy as np | |
| import pylab | |
| def thresholding_algo(y, lag, threshold, influence): | |
| signals = np.zeros(len(y)) | |
| filteredY = np.array(y) | |
| avgFilter = [0]*len(y) | |
| stdFilter = [0]*len(y) |
| #! /bin/bash | |
| # for this to work correctly, make an empty directory and put this shellscript inside it, along with the patch 'gtk3_make_filechooser_not_suck.patch'. | |
| # Running this in a directory with a previous gtk source tree or any other files or directories may make this script behave unexpectedly! | |
| # the patch file is found at: | |
| # https://gist.github.com/wyatt8740/ae82550264564e2bba49b58d3e07f0f5. | |
| # raw patch file (direct link): | |
| # https://gist.github.com/wyatt8740/ae82550264564e2bba49b58d3e07f0f5/raw/bc5bc32d15e852ba92a8b0b710e01960c371ba8b/gtk3_make_filechooser_not_suck.patch |
| diff -x '*.html' -x '*.png' -a -r -u a/gtk+-3.22.7/gtk/gtkfilechooserwidget.c b/gtk+-3.22.7/gtk/gtkfilechooserwidget.c | |
| --- a/gtk+-3.22.7/gtk/gtkfilechooserwidget.c 2016-12-30 09:55:56.000000000 -0500 | |
| +++ b/gtk+-3.22.7/gtk/gtkfilechooserwidget.c 2017-01-25 19:38:43.000000000 -0500 | |
| @@ -2420,7 +2420,10 @@ | |
| gdk_device_get_source (device) == GDK_SOURCE_TOUCHSCREEN; | |
| get_selection_modifiers (widget, event, &modify, &extend); | |
| - if (!is_touchscreen && | |
| + /* Ubuntu, disable the new behaviour of opening sometime on single click | |
| + it's confusing for users and the change had no rational |
| 'use strict'; | |
| const parseExpression = require("./parse-expression"); | |
| function findAll(regex, target) { | |
| let results = [], match; | |
| while (match = regex.exec(target)) { | |
| results.push(match); | |
| } |
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');This bash script offers quick shortcuts to simulate slower network connections. It is useful when you need to simulate a wireless network on a Linux network server, especially when you are using a virtual machine guest on your local machine or in the cloud.
slow 3G # Slow network on default eth0 down to 3G wireless speeds
slow 3G -l 600ms -p 10% # slow network on eth0 and setup latency to 600ms packetloss to 10%
slow reset # Reset connection for default eth0 to normal
slow vsat --latency=500ms # Simulate satellite internet with a high latency
slow dsl -b 1mbps # Simulate DSL with a slower speed than the default