Skip to content

Instantly share code, notes, and snippets.

View movermeyer's full-sized avatar

Michael Overmeyer movermeyer

View GitHub Profile
@movermeyer
movermeyer / download_mathnews.py
Created April 18, 2023 21:28
Downloads all issues from the mathNEWS website
import os
import re
import requests
from bs4 import BeautifulSoup
MATHNEWS_URL = "https://mathnews.uwaterloo.ca"
def get_all_tags(url):
tags = set()
@movermeyer
movermeyer / export.md
Last active April 12, 2023 16:41
Exporting large Slack channel member lists

You can bulk import Slack channel members into a Workplace by Meta™️ group. Here's how.

Small channels (< 1000 members)

If a channel has < 1000 members, you can click on Copy member email addresses in the settings for the channel:

image

Once you have this, pop open a terminal and enter the following to create a CSV file:

@movermeyer
movermeyer / export.md
Created January 18, 2023 13:39
Exporting group member emails from Workplace by Meta™️
  1. Open the WxM™️ group in the browser
  2. Open the developer tools (F12)
  3. Go to network tab
  4. Filter requests by /graphql
  5. Open the members list in the group
  6. Scroll down all the way to the bottom of the list
  • You should now have 1 request per ~20 users in the channel.
  1. Save the requests into a HAR format file
--docker run -i -t --rm=true -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres
\set VERBOSITY verbose
CREATE DATABASE test_db;
\c test_db
create extension dblink;
create table test_table
(
@movermeyer
movermeyer / Dockerfile
Created April 20, 2016 13:12
A basic Dockerfile that deploys a searchcode Community Edition server
FROM java:openjdk-8-jre
RUN apt-get update && apt-get install -y \
curl \
tar
RUN curl -o searchcode-server-community.tar.gz https://searchcode.com/static/searchcode-server-community.tar.gz \
&& tar xvfz searchcode-server-community.tar.gz
WORKDIR /searchcode-server-community/release
@movermeyer
movermeyer / stream_test.py
Last active February 16, 2016 21:56
stream processing error
from stream import map, ForkedFeeder, ProcessPool, PCollector
#Collector works with ForkedFeeder
collector = PCollector()
for i in range(10):
ForkedFeeder(lambda: (i for i in xrange(10))) >> collector
print len([x for x in collector])
#Collector does not work with ProcessPool
Here are my installed pip modules:
alabaster (0.7.6)
argparse (1.4.0)
Babel (2.1.1)
cairocffi (0.7.2)
cffi (1.3.0)
distribute (0.6.10)
Django (1.4)
django-tagging (0.3.1)
@movermeyer
movermeyer / Dockerfile
Created October 20, 2015 14:36
pip issue while installing lxml
#The 'latest' centos image is centos7
FROM centos:centos6
#Install EPEL
RUN yum -y install epel-release
# Make sure the package repository is up to date.
RUN yum -y update
#Install Python
@movermeyer
movermeyer / gist:220f87b34eba730bb67b
Created August 10, 2015 20:30
Fix to issue #60 causes infinite loop
import multiprocessing
import time
import firebirdsql
FIREBIRD_HOST = "localhost"
FIREBIRD_DB = "D:\\LOCALCONFIG.fdb"
FIREBIRD_USER = "SYSDBA"
FIREBIRD_PASS = "masterkey"
def test(number_to_select):
import firebirdsql
FIREBIRD_HOST = "localhost"
FIREBIRD_DB = "D:\\Databases\\TEST.fdb"
FIREBIRD_USER = "SYSDBA"
FIREBIRD_PASS = "masterkey"
conn = firebirdsql.connect(host=FIREBIRD_HOST, database=FIREBIRD_DB, user=FIREBIRD_USER, password=FIREBIRD_PASS)
cur = conn.cursor()