Skip to content

Instantly share code, notes, and snippets.

View barkerja's full-sized avatar
🏠
I have the complete picture — This changes the picture entirely

John Barker barkerja

🏠
I have the complete picture — This changes the picture entirely
  • Dryden, NY
View GitHub Profile

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@jacquesbh
jacquesbh / Use Yubikey (GPG key) for SSH.md
Last active January 3, 2024 14:59
Use my Yubikey with GPG keys to SSH with a guest computer (OSX or Windows)
@bcomnes
bcomnes / git-gpg.md
Last active June 21, 2025 19:42
my version of gpg on the mac
  1. brew install gnupg, pinentry-mac (this includes gpg-agent and pinentry)

  2. Generate a key: $ gpg --gen-key

  3. Take the defaults. Whatevs

  4. Tell gpg-agent to use pinentry-mac:

    $ vim ~/.gnupg/gpg-agent.conf 
    
  • Bot initializers now only use named parameters. This shouldn't be a hard change to adjust to, but everyone will have to do it. Here's some examples:
# Previously
bot = Discordrb::Bot.new 'email@example.com', 'hunter2', true

# Now
bot = Discordrb::Bot.new email: 'email@example.com', password: 'hunter2', log_mode: :debug
# Previously
@jfsiii
jfsiii / fetch-chunked.js
Last active April 24, 2026 13:43
Quick example of using fetch to parse a chunked response
var chunkedUrl = 'https://jigsaw.w3.org/HTTP/ChunkedScript';
fetch(chunkedUrl)
.then(processChunkedResponse)
.then(onChunkedResponseComplete)
.catch(onChunkedResponseError)
;
function onChunkedResponseComplete(result) {
console.log('all done!', result)
}
@Restuta
Restuta / the-bind-problem.jsx
Last active March 16, 2024 00:22
React, removeEventListener and bind(this) gotcha
/* Sometimes it's pretty easy to run ito troubles with React ES6 components.
Consider the following code: */
class EventStub extends Component {
componentDidMount() {
window.addEventListener('resize', this.onResize.bind(this)); //notice .bind
}
componentWillUnmount() {
window.removeEventListener('resize', this.onResize.bind(this));
@steventroughtonsmith
steventroughtonsmith / gist:6788b6c340a0aa52345a
Created October 27, 2015 05:19
Run OS X Screen Saver as Wallpaper
/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background
@ianblenke
ianblenke / rethinkdb.cloud-init
Created March 13, 2015 21:59
Rethink-DB CoreOS cloud-init
#cloud-config
coreos:
units:
- name: rethinkdb-create-fleet-units.service
command: start
content: |
[Unit]
After=docker.service
ConditionFileIsExecutable=/srv/rethinkdb-create-fleet-units.sh
ConditionFileNotEmpty=/srv/rethinkdb@.service
@elifarley
elifarley / reql.py
Last active August 29, 2015 14:16 — forked from RedBeard0531/functions.js
Compute sample standard deviation, coefficient of variation and other stats over large datasets in RethinkDB using Map-Reduce in ReQL. See https://github.com/rethinkdb/rethinkdb/issues/3769#issuecomment-77229538
> load('functions.js')
> db.stuff.drop()
false
> db.stuff.insert({value:1})
> db.stuff.insert({value:2})
> db.stuff.insert({value:2})
> db.stuff.insert({value:2})
> db.stuff.insert({value:3})
> db.stuff.mapReduce(map, reduce, {finalize:finalize, out:{inline:1}}).results[0]
{
@koistya
koistya / App.js
Last active June 8, 2022 09:55
How to add `onscroll` event in ReactJS component
import React from 'react';
let lastScrollY = 0;
let ticking = false;
class App extends React.Component {
componentDidMount() {
window.addEventListener('scroll', this.handleScroll, true);
}