Skip to content

Instantly share code, notes, and snippets.

View EdwardHinkle's full-sized avatar

Eddie Hinkle EdwardHinkle

View GitHub Profile
@cleverdevil
cleverdevil / transform.py
Last active March 6, 2018 00:54
Transform Facebook JSON exports to MF2 JSON
#!/usr/bin/env python
'''
Usage:
./transform <path-to-facebook-export.json>
This will transform everything using granary and then place
individual files into a directory called "mf2."
@grantcodes
grantcodes / rel-scraper.js
Last active October 30, 2017 23:02
Simple function to get all rel links from a html string
export default function (htmlString, url) {
let rels = {};
let baseUrl = url;
const doc = new DOMParser().parseFromString(htmlString, 'text/html');
const baseEl = doc.querySelector('base[href]');
const relEls = doc.querySelectorAll('[rel][href]');
if (baseEl) {
const value = baseEl.getAttribute('href');
@martymcguire
martymcguire / _plugins_podcast_rss.rb
Last active August 29, 2023 07:46
A Jekyll layout for a podcast RSS feed. Each podcast has an entry in `_podcasts/` with metadata. Items are `_posts/` entries with episode content that match a specified tag.
module Jekyll
class PodcastRssPage < Page
def initialize(site, base, dir, post)
@site = site
@base = base
@dir = dir
@name = 'feed.rss'
self.process(@name)
@benjamincharity
benjamincharity / autonomous.txt
Last active April 30, 2024 11:59
Instructions on how to reset the autonomous desk. This fixes a problem where the desk will not lower (also reportedly fixes incorrectly reported heights).
> Thank you for reaching out to Autonomous! I am sorry to hear that you are having some trouble with your SmartDesk
> but I will be glad to assist. It sounds like your system needs a "hard reset" can I please have you follow these
> steps thoroughly.
Reset Steps:
1. Unplug the desk for 20 seconds. Plug it back in. Wait a full 20 seconds.
2. Press the up and down buttons until the desk lowers all the way and beeps or 20 seconds pass.
3. Release both buttons.
4. Press the down buttons until the desk beeps one more time or 20 seconds pass.
@springmeyer
springmeyer / campus-maps.md
Last active November 6, 2018 03:29
Campus Map Technology
@bumbu
bumbu / Cytoscape.js - Adding compound element on the fly
Created June 13, 2013 08:13
Cytoscape.js - Adding compound element on the fly
$("#button").click(function(){
var list = cy2.filter(function (i, ele) {
return (parseInt(ele.id().slice(1), 10) % 2 === 0);
});
var nodes = [];
// Create new parent
nodes.push({group: "nodes", data: {id: "n0"}, position: {x: 0, y: 0}});
// Create copies of old nodes
@amitchhajer
amitchhajer / Count Code lines
Created January 5, 2013 11:08
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n