Skip to content

Instantly share code, notes, and snippets.

@ThomasLeister
ThomasLeister / mastodon-tootctl-media-purge.txt
Created February 21, 2019 19:07
How to automatically remove cached media files older that 7 days from your Mastodon instance
This is how to automatically delete cached image previews from your Mastodon instance if they are older than 7 days.
Log in as your "mastodon" User or log in as root and then change to the "mastodon" user, who runs Mastodon:
# su - mastodon
Open crontab:
$ crontab -e
... and add these lines to your crontab:
@wolever
wolever / jquery.toggleClassPrefix.js
Created January 13, 2014 04:51
jQuery plugin to toggle an element's classes based on a prefix.
/**
* Toggles the CSS classes of an element based on a prefix::
* > elems = $(".status")
* > elems
* [<div class="status status-active">, <div class="status status-pending">]
* > elems.toggleClassPrefix("status-", "status-pending")
* > elems
* [<div class="status status-pending">, <div class="status status-pending">]
*/
$.fn.toggleClassPrefix = function(prefix, toAdd) {
@jvns
jvns / interview-questions.md
Last active April 25, 2024 15:52
A list of questions you could ask while interviewing

A lot of these are outright stolen from Edward O'Campo-Gooding's list of questions. I really like his list.

I'm having some trouble paring this down to a manageable list of questions -- I realistically want to know all of these things before starting to work at a company, but it's a lot to ask all at once. My current game plan is to pick 6 before an interview and ask those.

I'd love comments and suggestions about any of these.

I've found questions like "do you have smart people? Can I learn a lot at your company?" to be basically totally useless -- everybody will say "yeah, definitely!" and it's hard to learn anything from them. So I'm trying to make all of these questions pretty concrete -- if a team doesn't have an issue tracker, they don't have an issue tracker.

I'm also mostly not asking about principles, but the way things are -- not "do you think code review is important?", but "Does all code get reviewed?".

@jvns
jvns / blogs.md
Last active April 16, 2020 09:34
Tech blogs I subscribe to
@martijnvermaat
martijnvermaat / gitlab-ipython-notebook.md
Last active May 8, 2023 00:53
View IPython notebooks in GitLab

Viewing IPython notebooks in GitLab

GitLab is open source software to collaborate on code (a GitHub clone to run on your own server). Clicking a blob (a file in a repository) in GitLab shows a nice rendering if GitLab supports the file type (e.g., images, Markdown documents), or its content as plain text otherwise. The patch described here adds support to GitLab for rendering IPython notebooks (.ipynb files).

@geoffmomin
geoffmomin / notepadapp.html
Created May 8, 2013 19:08
SPAN: Simple Persistent Application for Note-taking. Download it and use it for whatever you want.
<!DOCTYPE html> <!--Sets the document type to HTML-->
<html> <!--Now we begin describing the web page-->
<script> <!-- We are using inline javascript. That is Javascript inside HTML //-->
var note, html, timeout; <!-- Set the variables //-->
window.addEventListener('load', function() {
note = document.getElementById('note');
html = document.getElementsByTagName('html')[0];
html.addEventListener('keyup', function(ev) {
if (timeout) clearTimeout(timeout);
timeout = setTimeout(saveNote, 100);
@juliepagano
juliepagano / 101_off_limits.md
Last active December 16, 2020 09:37
101 conversations I generally don't want to have...

This list now exists over at http://juliepagano.com/blog/2013/11/02/101-off-limits/ and will be updated there.

I keep saying that impromptu, unwanted feminism 101 discussions are exhausting and not a good use of my resources. Then people ask what I mean by 101, so I'm starting to make a list. This list will change over time - I recommend checking back.

I highly recommend checking this list before engaging with me about feminism if you're new to it. It'll save both of us a lot of time and frustration.

Diversity in tech

Women aren't equally represented in tech because biology

Nope. This argument is bad and the science does not support it. Unfortunately, every time you say this out loud, you are contributing to cultural problems that do decrease the number of women in tech.

@joshski
joshski / flame.lua
Created April 21, 2013 10:52
Generates a little flame. Works in Codea.
-- a little flame in a functional style
function particle(step, style, t)
local newStyle = step(style, t)
return {
style = newStyle,
next = function()
return particle(step, newStyle, t + 1)
end
}
@dideler
dideler / unique.py
Last active April 8, 2024 04:17
Removing duplicate lines from a file in Python
#!/usr/bin/python
"""
Playing around with slightly various ways to simulate uniq in Python.
The different strategies are timed.
Only m1() and m2() do not change the order of the data.
`in` is the input file, `out*` are output files.
"""
infile = 'in' # Change filename to suit your needs.