This is a bash script, as an example, on how to do click-testing GUI based on finding components based on how they look.
- opencv
- scrot
- findimage
- xdotool
import re | |
# http://atomboy.isa-geek.com/plone/Members/acoil/programing/double-metaphone | |
from metaphone import dm as double_metaphone | |
# get the Redis connection | |
from jellybean.core import redis | |
import models | |
# Words which should not be indexed |
GitHub.TreeSlider = function () { | |
if (window.history && window.history.pushState) { | |
function a() { | |
if (e.sliding) { | |
e.sliding = false; | |
$(".frame-right").hide(); | |
$(".frame-loading:visible").removeClass("frame-loading") | |
} | |
} | |
if (!($("#slider").length == 0 || !GitHub.shouldSlide)) if (!navigator.userAgent.match(/(iPod|iPhone|iPad)/)) { |
import glob | |
# declare types of commands | |
C_ARITMETIC = object() | |
C_PUSH = object() | |
C_POP = object() | |
C_LABEL = object() | |
C_GOTO = object() | |
C_IF = object() | |
C_FUNCTION = object() |
git fetch | |
# check if a deploy is necessary | |
checked_out=$(git rev-parse HEAD) | |
production=$(git rev-parse origin/production) | |
if [ $checked_out = $production ]; then | |
echo 'Nothing to deploy. Moving on...' | |
exit 0 | |
fi |
#!/usr/bin/lua | |
-- Metrics web server (0.1) | |
-- Copyright (c) 2015 Kevin Lyda | |
-- Apache 2.0 License | |
socket = require("socket") | |
netsubstat = {"IcmpMsg", "Icmp", "IpExt", "Ip", "TcpExt", "Tcp", "UdpLite", "Udp"} | |
cpu_mode = {"user", "nice", "system", "idle", "iowait", "irq", | |
"softirq", "steal", "guest", "guest_nice"} | |
netdevsubstat = {"receive_bytes", "receive_packets", "receive_errs", |
This is a bash script, as an example, on how to do click-testing GUI based on finding components based on how they look.
#!/bin/ash | |
# | |
# angry_wifi.sh | |
# | |
# auto disconnects clients with a low signal strength on LEDE / OpenWRT. great | |
# for clients who hold onto a lower-signal-strength accesspoint instead of | |
# roaming. before running, make sure to download the latest MAC addresses with: | |
# | |
# wget --no-check-certificate -O - 'https://services13.ieee.org/RST/standards-ra-web/rest/assignments/download/?registry=MAC&text=apple' | cut -d, -f2 > apple_mac_addresses | |
# |
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.