Skip to content

Instantly share code, notes, and snippets.

View beporter's full-sized avatar

Brian Porter beporter

View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active May 9, 2024 21:12
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@charlietran
charlietran / TerminalVim.scpt
Last active October 14, 2023 06:50
Open file in iTerm vim for MacOS Sierra
-- TerminalVim.app
-- This creates a shim Application that will enable you to open files from the Finder in vim using iTerm
-- To use this script:
-- 1. Open Automator and create a new Application
-- 2. Add the "Run Applescript" action
-- 3. Paste this script into the Run Applescript section
-- 4. Save the application as TerminalVim.app in your Applications folder
-- 5. In the Finder, right click on a file and select "Open With". In that window you can set TerminalVim as a default
@richard-scott
richard-scott / 00_description
Created December 13, 2016 10:52 — forked from halberom/00_description
ansible - example of using filters to change each item in a list
The problem:
I wanted to use the jinja 'map' filter to modify each item in a string, in this simple
example, adding '.conf' to each item.
The 'format' filter in jinja takes arguments (value, *args, **kwargs). Unfortunately,
it uses 'value' as the pattern. When called inside map 'value' is the current item in
the list, or in other words *args as far as format is concerned. So it's the wrong way
around.
@matthiaskern
matthiaskern / feedly_export_saved_for_later.js
Last active June 30, 2017 02:27
Small script to fetch saved for later items from feedly as JSON. Based on https://gist.github.com/bradcrawford/7288411
if(!(window.jQuery)) {
var script = document.createElement("script");
script.setAttribute("src", "https://code.jquery.com/jquery-2.2.1.min.js");
script.setAttribute("type", "text/javascript");
script.onload = logItems;
document.getElementsByTagName("head")[0].appendChild(script);
} else {
logItems();
}
@poke
poke / gw2-item-search.html
Created January 13, 2016 20:44
Guild Wars 2: Item search
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Guild Wars 2: Item search</title>
</head>
<body>
<div id="loader">Loading…</div>
<div id="app" style="display: none;">
@jmauerhan
jmauerhan / pre-commit.php
Last active July 13, 2018 22:48
A pre-commit hook written in php to fix code style and alert about phpmd rules
#!/usr/bin/php
<?php
require __DIR__ . '/../../vendor/autoload.php';
/**
* Dependencies:
* - Symfony Console Component: symfony/console
* - Symfony Process Component: symfony/process
* - PHP Mess Detector: phpmd/phpmd
@FrancesCoronel
FrancesCoronel / sampleREADME.md
Last active March 26, 2024 01:21
A sample README for all your GitHub projects.

Repository Title Goes Here

Frances Coronel

INSERT GRAPHIC HERE (include hyperlink in image)

Subtitle or Short Description Goes Here

ideally one sentence >

@willurd
willurd / web-servers.md
Last active May 10, 2024 05:14
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@gnarf
gnarf / ..git-pr.md
Last active April 12, 2024 22:00
git pr - Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
@ccstone
ccstone / BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
Last active March 30, 2024 07:53
BBEdit-TextWrangler Regular Expression Cheat-Sheet
————————————————————————————————————————————————————————————————————————————————————————————————————
BBEdit / BBEdit-Lite / TextWrangler Regular Expression Guide Modified: 2018/08/10 01:19
————————————————————————————————————————————————————————————————————————————————————————————————————
NOTES:
The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use.
Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete.