Skip to content

Instantly share code, notes, and snippets.

@100ideas
100ideas / brew-lsbrews
Last active March 17, 2022 04:11
lsfuncs.fish: Print user-defined Fish functions (including any executable files in first path of `$fish_user_paths`)
#!/usr/bin/env bash
#
#!/usr/bin/env bash
#: Usage: brew lsbrews [OPTION]
#:
#: list name: description of all instealled "leaf" formulae
#:
# disables logging the script's contents to .bash_history
set +o history
@glasslion
glasslion / vtt2text.py
Last active August 25, 2024 09:25
This script convert youtube subtitle file(vtt) to plain text.
"""
Convert YouTube subtitles(vtt) to human readable text.
Download only subtitles from YouTube with youtube-dl:
youtube-dl --skip-download --convert-subs vtt <video_url>
Note that default subtitle format provided by YouTube is ass, which is hard
to process with simple regex. Luckily youtube-dl can convert ass to vtt, which
is easier to process.
@bmiles
bmiles / biocoder_python_Oct_2015.py
Created September 24, 2015 18:46
This code uses Autoprotocol-Python to generate Autoprotocol JSON for a simple bacterial incubation and OD600 measurement.
from autoprotocol.protocol import Protocol
p = Protocol()
# Set up the containers being referenced
ctrl_bacteria = p.ref("DH5a", id="3209xifd029", cont_type="micro-1.5", discard=True)
growth_plate = p.ref("growth_plate", id="3208kfhf394", cont_type="96-flat", storage="cold_4")
# Dispense, transfer, cover the plate, incubate, measure OD600
p.dispense(growth_plate, "lb-broth-noAB", [{"column": "0", "volume": "150:microliter"}])
p.transfer(ctrl_bacteria.well(0), growth_plate.wells_from(0,4, columnwise=True), "2:microliter")
@judell
judell / mmr.py
Last active March 23, 2022 10:46
monthly morphometry report
import requests, re, json, types, traceback
class HypothesisAnnotation:
def __init__(self, row):
"""Encapsulate relevant parts of one row of a Hypothesis API search."""
self.tags = []
if row.has_key('tags') and row['tags'] is not None:
self.tags = row['tags']
@willcanine
willcanine / gist:76c01fd3da6f01b8cd9c
Last active August 29, 2015 14:14 — forked from Cixelyn/gist:8353ce715bee8e1dc82a
OpenTrons Protocol Datastructure *ALPHA*

#OpenTrons Protocol Datastructure ALPHA ###(SUBJECT TO CHANGE)

The OT.One runs jobs based on a JSON datastructure. This "low-level" definiton provides volume, container, and location specific information, describing protocols at the liquid transfer level (as opposed to Barista's higher level description).

It is based loosely on [Transcriptic's Autoprotocol] (https://www.transcriptic.com/platform/#instructions). We modified it to suit platforms beyond Transcriptic's robotic work cells, parsing out the platform specific information into a separate file with information particular to the OT platform. This should empower biodevelopers to easily develop and test protocols on their local machine, and then quickly scale them to "the cloud."

Please send any questions to info@opentrons.com!

Screencapture and animated gifs

I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).

Capturing (Easy)

  1. Launch quicktime player
  2. do Screen recording

screen shot 2014-10-22 at 11 16 23 am

package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"net/url"
"os/exec"
"strconv"
@hlung
hlung / How to connect PS3 controller to a Mac or PC.md
Last active July 22, 2024 21:41
How to connect PS3 controller to a Mac or PC

How to connect PS3 controller to a Mac or PC

This is how you connect PS3 controller to Mac OSX, PC, etc. when previously connected to a PS3. You will need a Mini USB cable. Overcome your laziness, get up of your chair, and go get one!

A big misconception is that keep holding PS button will reset the controller's pairing. It DOES NOT! From my testings, the controller keeps paring with the last machine it was CONNECTED VIA A USB CABLE.

Here are the steps:

@ttscoff
ttscoff / grab links.bookmarklet
Last active June 16, 2024 16:40
Create a bookmark and paste the code from `grab links.bookmarklet` into the url. Trigger it on a page containing links you want to save and then click the section of the page containing the links. A Markdown list of all links will be generated, and clicking the resulting list will select all for copying.
@sam1vp
sam1vp / index.html
Last active December 10, 2015 22:08
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<style>
#chart svg {
height: 400px;
}