Skip to content

Instantly share code, notes, and snippets.

@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active April 29, 2024 17:57
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hardbap
hardbap / upgrade_postgres.txt
Last active December 14, 2016 01:28
Upgrading postgresql from 9.4.x to 9.5.x with Hstore
# Orignal instructions here: https://kkob.us/2016/01/09/homebrew-and-postgresql-9-5/
1. Stop postgresql
$ launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
2. Install postgresql 9.5
$ brew update && brew upgrade postgresql
3. Make a new 9.5 database
$ initdb /usr/local/var/postgres9.5 -E utf8
@joepie91
joepie91 / vpn.md
Last active May 3, 2024 10:58
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@gaearon
gaearon / combining.js
Created June 3, 2015 18:03
Combining Stateless Stores
// ------------
// counterStore.js
// ------------
import {
INCREMENT_COUNTER,
DECREMENT_COUNTER
} from '../constants/ActionTypes';
const initialState = { counter: 0 };

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@jessegrosjean
jessegrosjean / AppDispatcher.js
Last active December 23, 2015 01:03
Reflux style wrapper around Flux
var copyProperties = require('react/lib/copyProperties'),
Dispatcher = require('flux').Dispatcher,
util = require('util');
function AppDispatcher() {
Dispatcher.call(this);
this._queue = [];
}
util.inherits(AppDispatcher, Dispatcher);
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end
@smsohan
smsohan / rename_angular_parts
Last active April 28, 2016 15:55
AngularJS renaming exercise
Because I think the hardest part of getting started with AngularJS is it's esoteric names, I'm suggesting the following replacements of the AngularJS terminology.
scope -> state
factory -> data/models
filter -> helper
directive {restrict: 'E'} -> custom_tag
directive {restrict: 'A'} -> custom_attribute