Skip to content

Instantly share code, notes, and snippets.

View tdsmith's full-sized avatar

Tim D. Smith tdsmith

View GitHub Profile
1574121600000
1595721600000
null
1576454400000
1568246400000
1509494400000
1575331200000
1554076800000
1587340800000
1581984000000
{
"experiment_url": "https://experimenter.services.mozilla.com/experiments/search-topsites/",
"type": "addon",
"name": "Activity Stream Search TopSites",
"slug": "search-topsites",
"public_name": "TopSites for Search",
"public_description": "We believe we can deliver an enhanced product experience by exposing these Topsites in a new context, allowing users to navigate even more quickly and easily than they can today.",
"status": "Complete",
"client_matching": "Prefs: Exclude users with the following prefs:\r\n\r\nbrowser.newtabpage.activity-stream.feeds.topsites = false\r\nbrowser.privatebrowsing.autostart = true\r\n\r\nExperiments:\r\n\r\nAny additional filters:",
"locales": [],
bq show --schema $1 | \
jq -r '.[] | recurse(.fields[]? + {parent: ((.parent? // []) + [.name])}) | .parent + [.name] | join(".")'
@tdsmith
tdsmith / twevernote.py
Created December 24, 2012 21:45
A little script to dump your Twitter .zip archive into an Evernote notebook on OS X. For, you know, cloudiness. Loads tweets at about one per second, so don't expect it to be super-zippy. pip install appscript if you haven't, yet, which will give you aem.
#!/usr/bin/env python
import json, appscript, aem, sys, os, glob, datetime
def usage(called_name):
print 'Usage: %s <path to unzipped twitter archive> <name of Evernote notebook>' % called_name
print 'e.g., %s tweets/ "My Tweets"' % called_name
def main(tweet_path, notebook_name):
if not os.path.isdir(tweet_path):
from hashlib import sha256
from json import dumps
from math import floor
from uuid import uuid4
def evalute(input, bucket_start, bucket_width, n_buckets):
value = sha256(dumps(input).replace(" ", "").encode("utf-8")).hexdigest()[:12]
wrapped_start = bucket_start % n_buckets
end = wrapped_start + bucket_width
import tifffile as tf
import numpy as np
from os.path import splitext
def z_project(fn):
tiff = tf.TiffFile(fn)
n = len(tiff.pages)
immap = np.arange(n).reshape((-1, 2), order='F')
d = {}
d['cars'] = immap[:-1,0]
CREATE TEMP FUNCTION json2array(json STRING)
RETURNS ARRAY<STRING>
LANGUAGE js AS """
return Object.keys(JSON.parse(json || "{}")).map(x => x.replace("CSSProperty", ""));
""";
WITH sample AS (
SELECT json2array(JSON_EXTRACT(payload, "$._blinkFeatureFirstUsed.CSSFeatures")) AS css
FROM httparchive.pages.2019_11_01_desktop
)
wilma:~ tim$ brew deps --tree tbb
tbb
wilma:~ tim$ brew remove tbb
Uninstalling /usr/local/Cellar/tbb/4.2...
wilma:~ tim$ brew install tbb
==> Downloading https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb42_20130725oss_src.tgz
Already downloaded: /Library/Caches/Homebrew/tbb-4.2.tgz
==> Patching
patching file build/version_info_macos.sh
@tdsmith
tdsmith / list.py
Last active December 12, 2015 03:08
A tool to help with Twitter list management. Shows you: a) people who are in your list who you don't follow and b) who you follow (newest first-ish), and whether your follows are in your list or not. To start, go to https://dev.twitter.com/apps, create a new app, and get app tokens. Use the dev web interface to create an OAuth token. Put those i…
#!/usr/bin/env python
import twython, secrets
from math import ceil
def cursored_request(method, sequence, *args, **kwargs):
myseq = []
nextCursor = -1
while nextCursor != 0:
kwargs['cursor'] = nextCursor
@tdsmith
tdsmith / gist:4478232
Last active December 10, 2015 18:58
QMJC planning meeting

Quantitative Microdevice Journal Club

Attending: Siavash Ahrar, David Li, Tim Smith; Kamran wandered in at some point

Unable to attend: Mindy Simon

Schedule

Once a month, in the third week? TBD.

Siavash will present first, since he has Feelings about how these should work so he can serve as a model.