Skip to content

Instantly share code, notes, and snippets.

Benjamin Charity benjamincharity

Block or report user

Report or block benjamincharity

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@larsxschneider
larsxschneider / readme.md
Last active Feb 28, 2019
Bookmarklet - Close all files in PR
View readme.md

Installation

Make a new bookmark in your browser. Set the name to Close all PR files (or something else you like) and set the URL to:

javascript:void((function(d){d.querySelectorAll('div:not(.Details--on) > div.file-header > div.file-actions > button').forEach(function(x){x.click()});})(document));

Usage

@sdkks
sdkks / iterm_nvim.AppleScript
Last active Nov 7, 2019
Open File with iTerm2 + nvim on OSX using Automator
View iterm_nvim.AppleScript
on run {input, parameters}
-- If run without input, open random file at $HOME
try
set filename to POSIX path of input
on error
set filename to "nvim-" & (do shell script "date +%F") & "__" & (random number from 1000 to 9999) & ".txt"
end try
-- Set your editor here
set myEditor to "/usr/local/bin/nvim"
-- Open the file and auto exit after done
@macbookandrew
macbookandrew / findStyles.js
Last active Oct 17, 2019
List unique CSS properties for all DOM elements
View findStyles.js
/**
* List unique CSS properties for all DOM elements
* Initially created to list unique font stacks on a page
* @see {@link http://stackoverflow.com/a/35022690/ Inspired by this StackOverflow answer}
*
* @see {@link https://gist.github.com/macbookandrew/f33dbbc0aa582d0515919dc5fb95c00a/ URL for this file}
*
* @author AndrewRMinion Design (https://andrewrminion.com)
* @version 1.1
*
@ericclemmons
ericclemmons / example.md
Last active Nov 11, 2019
HTML5 <details> in GitHub
View example.md

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 <summary>Summary Goes Here</summary>
@wesbos
wesbos / gist:0d5572a29e4f5688a1c8
Last active Jan 28, 2019
Handy list of widths to target in a responsive website
View gist:0d5572a29e4f5688a1c8
320
321
322
323
324
325
326
327
328
329
@adamreisnz
adamreisnz / Setup GitHub issue labels script
Last active Nov 17, 2016 — forked from hyubs/setup github issues labels.sh
A terminal script to setup GitHub issue labels for a project.
View Setup GitHub issue labels script
Setup GitHub issue labels script
@benjamincharity
benjamincharity / phoneInput.directive.js
Last active Feb 10, 2016
Keep a phone number within an input formatted while keeping the model clean with only numbers
View phoneInput.directive.js
export function PhoneInputDirective(
$filter, $browser, $timeout
) {
'ngInject';
const directive = {
restrict: 'A',
scope: {
phoneInput: '=',
},
@MoOx
MoOx / index.js
Last active Oct 29, 2019
Export/import github labels
View index.js
// go on you labels pages
// eg https://github.com/cssnext/cssnext/labels
// paste this script in your console
// copy the output and now you can import it using https://github.com/popomore/github-labels !
var labels = [];
[].slice.call(document.querySelectorAll(".label-link"))
.forEach(function(element) {
labels.push({
name: element.textContent.trim(),
@cletusw
cletusw / .eslintrc
Last active Oct 20, 2019
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
View .eslintrc
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
View embed-plunker.html
<iframe style="width: 100%; height: 600px" src="http://embed.plnkr.co/GvOO1itX8MG7zJLywSN8" frameborder="0" allowfullscren="allowfullscren"></iframe>
You can’t perform that action at this time.