Skip to content

Instantly share code, notes, and snippets.

View jedfoster's full-sized avatar

Jed Foster jedfoster

View GitHub Profile
@csswizardry
csswizardry / README.md
Last active April 2, 2024 20:17
Vim without NERD tree or CtrlP

Vim without NERD tree or CtrlP

I used to use NERD tree for quite a while, then switched to CtrlP for something a little more lightweight. My setup now includes zero file browser or tree view, and instead uses native Vim fuzzy search and auto-directory switching.

Fuzzy Search

There is a super sweet feature in Vim whereby you can fuzzy find your files using **/*, e.g.:

:vs **/*<partial file name><Tab>
.
├── actions
├── stores
├── views
│   ├── Anonymous
│   │   ├── __tests__
│   │   ├── views
│   │   │   ├── Home
│   │   │   │   ├── __tests__
│   │   │   │   └── Handler.js
@nathansmith
nathansmith / [1] convertToMarkup.js
Last active November 16, 2023 12:43
Handy utilities for dealing with `<div contenteditable="true">` areas.
// Helpers.
import { convertToText } from './';
/*
You would call this when receiving a plain text
value back from an API, and before inserting the
text into the `contenteditable` area on a page.
*/
const convertToMarkup = (str = '') => {
return convertToText(str).replace(/\n/g, '<br>');
@jedfoster
jedfoster / webkitmediasource-is-type-supported.html
Last active September 1, 2015 13:53 — forked from granoeste/webkitmediasource-is-type-supported.html
[JavaScript][HTML5][MediaSource] MediaSource.isTypeSupported
<!DOCTYPE html>
<html>
<head>
<script>
window.MediaSource = window.MediaSource || window.WebKitMediaSource;
function testTypes(types) {
for (var i = 0; i < types.length; ++i)
console.log("MediaSource.isTypeSupported(" + types[i] + ") : " + MediaSource.isTypeSupported(types[i]));
}
@jedfoster
jedfoster / sass-style-guide.md
Last active July 8, 2016 19:59
Coding Style Guide for Sass

Coding style

(Largely cribbed from GitHub's Styleguide)

Spacing

  • Use soft-tabs with a two space indent. Spaces are the only way to guarantee code renders the same in any person's environment.
  • Put spaces after : in property declarations.
  • Put line breaks between rulesets.
  • When grouping selectors, keep individual selectors to a single line.
@jedfoster
jedfoster / ext.vim
Last active August 29, 2015 14:11 — forked from sjl/ext.vim
" run command
" no stdin
" output displayed in "Press enter to continue" style
" current buffer untouched
:!uptime
" run command
" pipe range of text to command on stdin
" output replaces the range in the current buffer
:RANGE!grep foo
<ul class="matrix">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
@jedfoster
jedfoster / SassMeister-input-HTML.haml
Created January 1, 2014 23:56
Generated by SassMeister.com.
%ul.matrix
- (0..19).each do |c|
%li
@edrex
edrex / publish.sh
Last active May 5, 2016 21:27
Upload static site to S3 with clean URLs
#!/bin/sh
# Be sure to set the index and 404 docs to "index" and "404" respectively in your bucket settings
# replace with your compile command
harp compile ./ ./out
# removes the html extension
for f in `ls out/*.html out/**/*.html`; do mv $f "${f%%.*}"; done
@jedfoster
jedfoster / text.md
Last active February 28, 2016 00:55
SassMeister.com query string configuration

You can now append query string parameters to pre-configure SassMeister with a syntax, extension, or output style.

Available options are:

  • syntax: sass or scss
  • extension: any extension that SassMeister currently supports, by Gem name
  • output: expanded, nested, compact, or compressed

Examples