Skip to content

Instantly share code, notes, and snippets.

View eli-oat's full-sized avatar

Eli Mellen eli-oat

View GitHub Profile
<?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 / 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"
<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 / .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
@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 / 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 / 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 / select.md
Created March 27, 2018 15:11
trigger URL change on select element's change
<select onchange="location = this.options[this.selectedIndex].value;">
  <option>Please select</option> <option value="http://www.apple.com/">Apple</option>
  <option value="http://www.bbc.com">BBC</option> 
  <option value="http://www.facebook.com">Facebook</option> 
</select> 
@eli-oat
eli-oat / download-headers.php
Created April 12, 2018 17:01
PHP function to trigger file download, useful for echoing content to a file rather than to the DOM
<?php
function download_send_headers($filename) {
// disable caching
$now = gmdate("D, d M Y H:i:s");
header("Expires: Tue, 03 Jul 2001 06:00:00 GMT");
header("Cache-Control: max-age=0, no-cache, must-revalidate, proxy-revalidate");
header("Last-Modified: {$now} GMT");
// force download
@eli-oat
eli-oat / keybase.md
Created April 13, 2018 19:59
keybase.md

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 ASCYxjJW-cHzFuXAioAo5D-0jPn0ds6vUrUrAGMxLaUWPQo

To claim this, I am signing this object: