Skip to content

Instantly share code, notes, and snippets.

View Export MUBI lists.js
$('#multi-films .film-grid').children().map(function() {
var $this = $(this),
rank = $this.find('.list-film-position').text().trim(),
title = $this.find('.film-title').text().trim(),
dirYear = $this.find('.director-year').text().trim(),
re = dirYear.match(/^(.+), (\d+)$/),
dir = re ? re[1] : dirYear,
year = re ? re[2] : '';
return [rank, title, year, dir].join('\t');
View create_function_plv8_cuid.sql
-- original code:
-- Add the "plv8" extension
create extension if not exists "plv8";
-- Add the "pgcrypto" extension
create extension if not exists "pgcrypto";
-- Connect a database
from django.db.migrations.recorder import MigrationRecorder
>>> MigrationRecorder.Migration.objects.all()
>>> MigrationRecorder.Migration.objects.latest('id')
Out[5]: <Migration: Migration 0050_auto_20170603_1814 for model>
>>> MigrationRecorder.Migration.objects.latest('id').delete()
Out[4]: (1, {u'migrations.Migration': 1})

Star Trek TNG Ideal Types

Can be found in different ratios per episode.

  • Inexplicable being of pure energy.
  • Q acting the bellend.
  • Someone is horny.
  • Counsellor Troy's mum.
  • Holodeck rubbish.
  • Data learns something.
View makeScale.scd
// ""
~makeScale = { |ratios|
Tuning((ratios.ratiomidi % 12).sort)
$ PATH=$(npm bin):$PATH; git diff-tree --no-commit-id --name-only -r HEAD | xargs prettier --write
View artists-example.xml
<?xml version="1.0" encoding="UTF-8"?>
<image height="450" type="primary" uri="" uri150="" width="600" />
<image height="771" type="secondary" uri="" uri150="" width="600" />
<name>The Persuader</name>
<realname>Jesper Dahlbäck</realname>
$ docker exec -i $CONTAINER pg_restore --dbname=$DATABASE --verbose --clean -U $USER < pg_dump --format custom $DATABASE
View Elasticsearch install and uninstall.txt
#!/usr/bin/env sh
# checks to see if running
launchctl list | grep elasticsearch
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
launchctl remove homebrew.mxcl.elasticsearch
pkill -f elasticsearch
View .style.yapf
# .style.yapf
# Configuration file for the python formatter yapf.
# This configuration is based on the generic
# configuration published on GitHub.
# AUTHOR krnd
# VERSION v1.0