Skip to content

Instantly share code, notes, and snippets.

View ftrain's full-sized avatar

Paul Ford ftrain

View GitHub Profile
@ftrain
ftrain / n3tosql.pl
Last active April 30, 2021 16:54
Convert n3 triples to SQL in SQLite3, your own Very Shitty Triplestore.
#!/usr/bin/perl
while (<>) {
s/'/''/g;
/^([^\s]+)\s*([^\s]+)\s*(.+)\s+\.\s*$/;
my $s = $1;
my $p = $2;
my $o = $3;
$s=~s/[<>]//g;
$p=~s/[<>]//g;
@ftrain
ftrain / bing-gobble.pl
Created April 27, 2015 02:54
Get the counts for words on sites with bing!
#!/usr/bin/perl
# Copyright (c) 2015, Paul Ford, ford@ftrain.com
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
@beechnut
beechnut / wish-knew.md
Last active August 29, 2015 14:17
What I wish people new about coding

What I wish people knew about coding, including beginner programmers.

  • Coding isn't mystical.
    • Don't revere developers.
  • Getting started is hard, especially if you don't have a community of real, live people to help you out.
    • StackOverflow doesn't count. Meetups do.
  • The gap between the code you see on GitHub and running code is often massive. If you can't get a relatively simple codebase running quickly, it's probably because the developer assumes a lot about your system, not because you've done something wrong.
  • If code looks messy and scatterbrained, it probably is.
  • Read Ruby books. Avdi Grimm and Sandi Metz have a lot of important things you should read, whether you write Ruby or not.
  • So-called '10x programmers' leave 10x the technical debt of other programmers. The 10x myth has a cost.
#!/bin/bash
#
# _ _ __
# __ _ __ _ _ __| |__ (_)/ _|_ _
# / _` |/ _` | '__| '_ \| | |_| | | |
#| (_| | (_| | | | |_) | | _| |_| |
# \__, |\__,_|_| |_.__/|_|_| \__, |
# |___/ |___/
#
#
@ftrain
ftrain / actually.js
Last active November 10, 2023 01:16
A program that generates actuallies
/*
actually.js
_ _ _
__ _ __ _ __ _ __ _ ___| |_ _ _ __ _| | |_ _
/ _` |/ _` |/ _` |/ _` |/ __| __| | | |/ _` | | | | | |
| (_| | (_| | (_| | (_| | (__| |_| |_| | (_| | | | |_| |_
\__,_|\__,_|\__,_|\__,_|\___|\__|\__,_|\__,_|_|_|\__, ( )
|___/|/
*/
@jackrusher
jackrusher / drum-circle.clj
Created August 17, 2014 14:40
A little Godfried Toussaint inspired polyrhythmic drum toy online at http://jackrusher.com/drum-circle/
(ns drum-machine.core
(:require [om.core :as om :include-macros true]
[sablono.core :as html :refer-macros [html]]))
(enable-console-print!)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; UI
(def tau 6.2831853071)
@ftrain
ftrain / rhymes.clj
Last active July 14, 2023 22:20
Annotated rhyming dictionary
;; This is at: https://gist.github.com/8655399
;; So we want a rhyming dictionary in Clojure. Jack Rusher put up
;; this code here:
;;
;; https://gist.github.com/jackrusher/8640437
;;
;; I'm going to study this code and learn as I go.
;;
;; First I put it in a namespace.
@jackrusher
jackrusher / count-words.el
Last active July 5, 2019 13:00
I like to know how many words are in my markdown files.
;; this function is included in modern emacs, but here it is in case you haven't upgraded
(defun count-words (start end)
"Count words between START and END.
If called interactively, START and END are normally the start and
end of the buffer; but if the region is active, START and END are
the start and end of the region. Print a message reporting the
number of lines, words, and chars.
If called from Lisp, return the number of words between START and
@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google