Skip to content

Instantly share code, notes, and snippets.

View bignimbus's full-sized avatar
🙃

Jeff Auriemma bignimbus

🙃
View GitHub Profile
@bignimbus
bignimbus / redirect-to-docs.md
Last active September 15, 2023 18:18
github-boilerplates.md

Hi {{ name }}! Thanks for opening this Issue. I recommend reviewing this section of our docs: {{ title }}.

If nothing in the docs helps with what you're seeing, please consider posting in our Discord server or our Community Forum. The maintainers and other Apollo users are active on those platforms, they're great places to ask for help using Apollo {{ iOS/Client/Kotlin }}. In an effort to keep our Issues actionable, we're closing this Issue for now but please do feel free to re-open if there's a bug, documentation update, or feature idea that we should consider!

For more information about how to get the most out of the Apollo GraphQL Community, see this blog post 🚀

@bignimbus
bignimbus / .vimrc
Last active October 12, 2022 11:19
Set iTerm2 title to current buffer in vim
" Set the title of the Terminal to the currently open file
function! SetTerminalTitle()
let titleString = expand('%:t')
if len(titleString) > 0
let &titlestring = expand('%:t')
" this is the format iTerm2 expects when setting the window title
let args = "\033];".&titlestring."\007"
let cmd = 'silent !echo -e "'.args.'"'
execute cmd
redraw!
@bignimbus
bignimbus / fibonacci.js
Last active April 19, 2022 21:42
projecteuler.net Problem 2: Fibonacci sum. A JavaScript solution.
/*
projecteuler.net
Problem 2
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
*/
@bignimbus
bignimbus / amicable.js
Last active May 14, 2021 16:09
projecteuler.net Problem 21: Amicable numbers. A JavaScript solution.
/*
projecteuler.net
Amicable numbers
Problem 21
Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n).
If d(a) = b and d(b) = a, where a ≠ b, then a and b are an amicable pair and each of a and b are called amicable numbers.
For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110; therefore d(220) = 284. The proper divisors of 284 are 1, 2, 4, 71 and 142; so d(284) = 220.
Evaluate the sum of all the amicable numbers under 10000.
@bignimbus
bignimbus / imagemagick-convert.sh
Last active April 24, 2020 21:03
Here are some of my pet ImageMagick commands.
# converts a png image to jpeg
# all transparent regions will be converted to white
convert -flatten source.png destination.jpg

Keybase proof

I hereby claim:

  • I am bignimbus on github.
  • I am jeffauriemma (https://keybase.io/jeffauriemma) on keybase.
  • I have a public key ASCF2I-DD0nSd-2WFjybeqLVfE-bHCi9G6UlukU8Ibdq_Qo

To claim this, I am signing this object:

@bignimbus
bignimbus / Workflow.md
Last active January 30, 2019 17:37
Draft of HTML-CSS UI building workflow

Commit 1: enter all the content and order of how it will appear on the smallest supported screen. No structure, just literally only text and media nodes

Commit 2: enclose content in semantic tags. No layout considerations, just semantics. Headings get the appropriate <h#> tags, copy gets <p> tags, anchors get <a> tags, buttons get <button> tags, etc.

Commit 3: create an HTML layout out of block elements. <header>, <section>, <footer>, <nav>, <ul>, <ol>, etc. Sibling elements must have the same display value, otherwise nest them. E.g. a <span> can't be the sibling of a <div>. We still haven't written any CSS.

Commit 4: style all "inline" content, which encompasses elements with display: inline by default (e.g. text nodes, anchors, and spans). Styles should include resets, text colors, font sizes, line heights, font weights, etc. No margins, no padding, no heights, no widths (unless they are part of a CSS reset). No media queries, just get those inline elements styled for the s

const cropSvgToContentOnly = (svgElement) => {
const {
x,
y,
width,
height,
} = svgElement.getBBox();
const viewBoxValue = [x, y, width, height].join(' ');
svgElement.setAttribute('viewBox', viewBoxValue);
};
throw 'foo';
// throws an exception of type String and value "foo"
throw new Error('foo');
// throws an exception of type Error with message "foo"
foo();
// throws an exception of type ReferenceError (extends Error)
// with message "foo is not defined"
@bignimbus
bignimbus / example1.jsx
Last active March 3, 2018 03:34
React presentation source code examples
// From reactjs.org tutorial
class Square extends React.Component {
constructor(props) {
super(props);
this.state = { value: null };
}
render() {
return (
<button className="square" onClick={() => alert('click')}>