Skip to content

Instantly share code, notes, and snippets.

@ximeg
ximeg / ThresholdingAlgo.py
Created April 20, 2017 07:20
Python implementation of smoothed z-score algorithm from http://stackoverflow.com/a/22640362/6029703
#!/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)
@wyatt8740
wyatt8740 / update-gtk3.sh
Created April 2, 2017 21:42
Downloads latest debian GTK3 source, patches to fix annoyances, and compiles.
#! /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
@joepie91
joepie91 / index.js
Last active December 17, 2024 10:45
Breaking CloudFlare's "I'm Under Attack" challenge
'use strict';
const parseExpression = require("./parse-expression");
function findAll(regex, target) {
let results = [], match;
while (match = regex.exec(target)) {
results.push(match);
}
@rauchg
rauchg / README.md
Last active April 13, 2025 04:29
require-from-twitter

slow

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

slow

This bash script offers quick shortcuts to simulate slower network connections. It is useful when you need to simulate a wireless network on Linux, especially when you are using a virtual machine guest on your local machine or in the cloud.

Example commands: