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 / index.html
Created March 25, 2018 19:37
Stopwatch [A wicked simple stopwatch] // source https://jsbin.com/yubaki
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[A wicked simple stopwatch]">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Stopwatch</title>
</head>
<body>
<h1>Stopwatch</h1>
@eli-oat
eli-oat / media-endpoint.php
Created February 20, 2018 15:37 — forked from aaronpk/media-endpoint.php
an example of a Micropub Media Endpoint https://www.w3.org/TR/micropub/#media-endpoint
<?php
$token_endpoint = 'https://tokens.indieauth.com/token';
$base_url = 'https://media.aaronpk.com/';
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Authorization');
if(isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'text/plain') !== false) {
$format = 'text';
} else {
@eli-oat
eli-oat / emojis.json
Created December 18, 2017 14:26 — forked from oliveratgithub/emojis.json
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "👩‍👩‍👧‍👧", "name": "family_mothers_two_girls", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "p", "order": ""},
{"emoji": "👩‍👩‍👧‍👦", "name": "family_mothers_children", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "👩‍👩‍👦‍👦", "name": "family_mothers_two_boys", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128102;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "👨‍👩‍👧‍👧", "name": "family_two_girls", "shortname": "", "unicode": "", "html": "&#128104;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "p", "order": ""},
{"emoji": "👨‍👩‍👧‍👦", "name": "family_children", "shortname": "", "unicode": "", "html": "&#128104;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "👨‍👩‍👦‍👦", "name": "family_two_boys", "shortname": "", "unicode": "", "html": "&#128104;&zw
@eli-oat
eli-oat / .vimrc
Created October 24, 2017 02:03 — forked from jackbaty/.vimrc
.vimrc as of 2017-10-21
" My current .vimrc file
" Jack Baty
" jack@baty.net
" Environment
set nocompatible " We don't want vi compatibility.
filetype off " still needed?
set shell=/bin/bash\ -i
<style id="jsbin-css">
main > .tab:last-of-type {
order: 0;
}
main > article:last-of-type {
display: flex;
}
main > article:target ~ article {
display: none;
}
@eli-oat
eli-oat / downloader.sh
Created September 5, 2017 12:37
Download a website
#!/bin/bash
printf "\n\n Please enter the URL of the website you wish to download.\n Do not include leading 'http://' or 'https://'?\n\n\n"
printf " "
read URL
printf "\n\n Depending on the size of the website you just\n entered, this may take a few minutes.\n\n\n"
sleep 6
wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains ${URL} --no-parent http://${URL}
printf "\n\n DONE!\n\n\n"
<?php
function url_get_title($url)
{
if (!function_exists('curl_init'))
{
die('CURL is not installed!');
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
@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();
@eli-oat
eli-oat / micropub.php
Created May 11, 2017 02:06 — forked from adactio/micropub.php
Minimal micropub endpoint.
<?php
# Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
# http://creativecommons.org/publicdomain/zero/1.0/
$mysite = 'https://adactio.com/'; // Change this to your website.
$token_endpoint = 'https://tokens.indieauth.com/token';
$_HEADERS = array();
foreach(getallheaders() as $name => $value) {
@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