- Sexist, homophobic, racist, transphobic, ableist, sexist or otherwise offensive remarks are not allowed. (Swearing is allowed, but never targeting another user, and never in a hateful or sexually explicit manner.)
- Remarks that make any of the ops go “Hm, that’s inappropriate”, whether on the above list or not: also not allowed.
- You get a warning.
- If the warning is not taken seriously, you might get a second sterner warning in PM, if you’re lucky, and the op is feeling generous, and this is the first time. But don’t count on that.
- If the warning is unheeded, you get kicked.
- If you come back and continue to make trouble, you get banned.
- If you contact the offended party, and are truly apologetic, and it was the first offense, and the op who banned you feels it’s appropriate, then you may get un-banned.
- If an op bans you, I’m definitely not going to unban you unless they agree it’s a good idea.
- If an op bans someone, and you think it was unjustified, take it up with that op, or with a differe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import proj4 from 'proj4' | |
proj4.defs([ | |
[ | |
'CCCAMP2019', | |
'+proj=tmerc +ellps=GRS80 +lat_0=0 +lon_0=15 +k=0.9996 +x_0=114350 +y_0=-5877600 +units=m +no_defs', | |
], | |
]) | |
type CoordsLike = [number, number] | maplibregl.LngLat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
def deskew(im, max_skew=10): | |
height, width = im.shape | |
# Create a grayscale image and denoise it | |
im_gs = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY) | |
im_gs = cv2.fastNlMeansDenoising(im_gs, h=3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import socket | |
import sys | |
if len(sys.argv) != 3: | |
print "Usage: %s host:port destfile.jpg" % sys.argv[0] | |
sys.exit(1) | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
host, port = sys.argv[1].split(':') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import sys | |
from collections import namedtuple | |
rows = csv.reader(sys.stdin) | |
fields = [field.strip().lower().replace(' ', '_').replace('/', '_') | |
for field in rows.next() if field.strip() != ''] | |
PaypalRecord = namedtuple('PaypalRecord', fields) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" Sends Jenkins build duration statistics to Graphite. """ | |
import requests | |
import json | |
from graphite import Graphite # This is our closed-source library but you get the idea. | |
JENKINS_URL='http://jenkins' | |
GRAPHITE_HOST='10.x.x.x' | |
GRAPHITE_PREFIX='jenkins.main.build_time.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
from __future__ import division, absolute_import, print_function, unicode_literals | |
import csv | |
import boto3 | |
from zipfile import ZipFile | |
import io | |
import tempfile | |
from decimal import Decimal | |
import datetime | |
from collections import defaultdict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Download NASA MODIS imagery and use it as a desktop background. | |
# You'll need ImageMagick installed for this to work. | |
require 'date' | |
require 'net/http' | |
# Screen width/height | |
X = 2580 | |
Y = 1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Listen to a CurrentCost monitor on the serial port and forward data to Graphite | |
import serial | |
import socket | |
import time | |
from lxml import etree | |
ser = serial.Serial('/dev/ttyUSB0', 57600) | |
def send_metric(value): | |
sock = socket.socket() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# https://gist.github.com/gists/1186406 | |
import httplib2, json, re, sys | |
from optparse import OptionParser | |
parser = OptionParser() | |
parser.add_option("-w", "--warning", dest="warning", type="int", | |
default="50", help="warning threshold") | |
parser.add_option("-c", "--critical", dest="critical", type="int", | |
default="100", help="critical threshold") |
NewerOlder