Skip to content

Instantly share code, notes, and snippets.

@jnv
jnv / srt2txt.rb
Last active November 20, 2022 16:11
Converts SRT subtitles to plain text, strips irrelevant parts. Requires gems: srt, sanitize. Created for Doctor Who text analysis project.
#!/usr/bin/env ruby
require "srt"
require "sanitize"
REJECT_LINES = [/Best watched using Open Subtitles MKV Player/,
/Subtitles downloaded from www.OpenSubtitles.org/, /^Subtitles by/,
/www.tvsubtitles.net/, /[email protected]/, /addic7ed/, /allsubs.org/,
/www.seriessub.com/, /www.transcripts.subtitle.me.uk/, /~ Bad Wolf Team/,
/^Transcript by/, /^Update by /, /UKsubtitles.ru/
]
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active November 10, 2024 03:45
A badass list of frontend development resources I collected over time.
@alehandrof
alehandrof / Default.sublime-keymap
Last active October 3, 2017 16:13
Modal Navigation for: Sublime 3 w/ MultiBind & Colemak
// MultiBind
// Modal Navigation for Colemak -- inspired by [Miniguru](http://www.guru-board.com/english/layout_en)
{ "keys": ["alt+'"], "command": "multibind_toggle", "args" : { "layout": "modal-nav-colemak" } },
{ "keys": ["ctrl+shift+'"], "command": "multibind_show" },
{ "keys": ["escape"], "command": "multibind_toggle", "args" : { "layout": "default" }, "context": [ { "key": "multibind.modal-nav-colemak" } ] },
{ "keys": ["n"], "command": "move", "args": {"by": "characters", "forward": false}, "context": [ { "key": "multibind.modal-nav-colemak" } ] },
{ "keys": ["i"], "command": "move", "args": {"by": "characters", "forward": true}, "context": [ { "key": "multibind.modal-nav-colemak" } ] },
{ "keys": ["u"], "command": "move", "args": {"by": "lines", "forward": false}, "context": [ { "key": "multibind.modal-nav-colemak" } ] },
@olasitarska
olasitarska / pgessays.py
Created November 18, 2012 10:11
Builds epub book out of Paul Graham's essays.
# -*- coding: utf-8 -*-
"""
Builds epub book out of Paul Graham's essays: http://paulgraham.com/articles.html
Author: Ola Sitarska <[email protected]>
Copyright: Licensed under the GPL-3 (http://www.gnu.org/licenses/gpl-3.0.html)
This script requires python-epub-library: http://code.google.com/p/python-epub-builder/
"""
@sartak
sartak / a.md
Last active June 26, 2024 04:59
Anki 2 annotated schema
@weslly
weslly / generate.php
Created September 24, 2012 19:35
Generate line numbers to Sublime VintageLines plugin
<?php
// Set the content-type
header('Content-Type: image/png');
// Replace with your own font and font-size
$font = 'UbuntuMono-R.ttf';
$fontsize = 11;
// Create the numbers directory if it doesn't exist
if(!is_dir(dirname(__FILE__) . '/numbers/')) {
@sent-hil
sent-hil / pictures.markdown
Created August 24, 2012 02:18
River (getriver.com): Keep a programming journal.

One of my favorite past times is to look at the notebooks of famous scientists. Da Vinci's notebook is well known, but there plenty others. Worshipping Da Vinci like no other, I bought a Think/Create/Record journal, used it mostly to keep jot down random thoughts and take notes. This was great in the beginning, but the conformity of lines drove me nuts. Only moleskines made blank notebooks, so I had to buy one.

At the same time I started a freelance project. The project itself is irrelevant, but suffice to say it was very complex and spanned several months. It seemed like a perfect opportunity to use the moleskine. Looking back, all my entries fell under few categories:

  • Todo
  • Question
  • Thought
  • Bug
  • Feature
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@brandonb927
brandonb927 / osx-for-hackers.sh
Last active November 14, 2024 17:18
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@alganet
alganet / todo.php
Created June 23, 2012 00:49
A very small PHP todo list that saves to the database in 32 lines
<?php
//The actual implementation is just this file. Others are usage and tests.
class TodoList extends ArrayObject
{
const CREATE = 'CREATE TABLE IF NOT EXISTS tasks (name VARCHAR(32) PRIMARY KEY, status INT)';
const SELECT = 'SELECT * FROM tasks';
const INSERT = 'INSERT INTO tasks VALUES (?,?)';
const UPDATE = 'UPDATE tasks SET status = ? WHERE name = ?';