Skip to content

Instantly share code, notes, and snippets.

View eli-oat's full-sized avatar

Eli Mellen eli-oat

View GitHub Profile
@eli-oat
eli-oat / email-deadlines.php
Created January 14, 2016 22:40 — forked from cfenollosa/email-deadlines.php
Postpone your own email
#!/usr/bin/env php
<?php
// Script to postpone your own email. Parses IMAP folders and moves emails to a folder named "Today"
// Run this from a crontab, for example at 6 AM
// BSD License
// (C) Carlos Fenollosa, 2011-2016
// Read more about this script: http://cfenollosa.com/blog/a-simple-script-to-postpone-your-own-email.html
// Please leave comments and feedback for bugs and ideas!
@eli-oat
eli-oat / install-composer.sh
Created January 23, 2016 21:12 — forked from matthewpizza/install-composer.sh
Install Composer on Webfaction
cd $HOME
ln -s `which php54` ~/bin/php
export PATH=$HOME/bin:$PATH
curl -sS https://getcomposer.org/installer | php54
echo -e "\n# Composer\nalias composer=\"php54 \$HOME/composer.phar\"" >> $HOME/.bash_profile
source $HOME/.bash_profile
@eli-oat
eli-oat / definitions.json
Last active January 25, 2016 02:45
Idea for a document based database for museums and nonprofits
{
"definitions": {
"objectTypes": {
"person": 10,
"money": 20,
"event": 30,
"product": 40
},
"linkTypes": {
"from": -10,
#!/bin/bash
# These functions require a CouchDB instance
rawurldecode() {
# This is perhaps a risky gambit, but since all escape characters must be
# encoded, we can replace %NN with \xNN and pass the lot to printf -b, which
# will decode hex for us
@eli-oat
eli-oat / gist:8e82d2c6e7ba44db99bdf69c7f07d2c6
Created April 5, 2016 14:17 — forked from andphe/gist:3232343
Export your links from Safari reading list
/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g'

Keybase proof

I hereby claim:

  • I am eli-oat on github.
  • I am eli_oat (https://keybase.io/eli_oat) on keybase.
  • I have a public key ASD3EfgVqnMzQObl5EV104NtVgnQwMtvndPBqTW7T6V1Two

To claim this, I am signing this object:

# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@eli-oat
eli-oat / writer.vim
Last active March 22, 2017 15:13
Make mvim feel more like ia writer
" make mvim feel like ia writer
" touch .vim/writer.vim
" then call when editing markdown :source ~/.vim/writer.vim
set background=light
set nonu
set laststatus=0
colorscheme default
hi FoldColumn guibg=white
set foldcolumn=12
@eli-oat
eli-oat / .vimrc
Last active May 29, 2017 04:06
.vimrc (as of 2016-12-13)
" AS OF 2017-05-29
set nocompatible
filetype off
set number
" typography and whatnot, note that this is a non-standard font
" instal hack: https://github.com/powerline/fonts
set guifont=Hack:h18
set background=light
@eli-oat
eli-oat / get-title.md
Created June 14, 2017 01:49
Get title attribute form a URL via PHP curl

Currently, whenever I reply to or like a link the source URL displays. I've found a really sturdy way to parse content titles, but the performance is absolutely abysmal. Wicked wicked wicked slow. I think it may be something to do with how I'm invoking the function. I'll keep poking at it, though, since it makes for a much better presentation.

function url_get_title($url)
    {
    if (!function_exists('curl_init'))
        {
        die('CURL is not installed!');
        }
    $ch = curl_init();