Skip to content

Instantly share code, notes, and snippets.

View ritchiey's full-sized avatar

Ritchie Young ritchiey

View GitHub Profile
@mindbrave
mindbrave / declarative.html
Created October 4, 2018 12:48
Why declarative > imperative. Simple example.
<html>
<head>
<title>Declarative!</title>
</head>
<body>
<h1>Declarative!</h1>
</body>
</html>
@iscott
iscott / simple_authentication_rails_5_bcrypt_and_has_secure_password.md
Last active March 15, 2024 03:23
Cheat Sheet: Simple Authentication in Rails 5 with has_secure_password

Cheat Sheet: Simple Authentication in Rails 6 with has_secure_password

The goal of this cheatsheet is to make it easy to add hand-rolled authentication to any rails app in a series of layers.

First the simplest/core layers, then optional layers depending on which features/functionality you want.

Specs
AUTHOR Ira Herman
LANGUAGE/STACK Ruby on Rails Version 4, 5, or 6
@rtorr
rtorr / README.md
Last active February 26, 2023 20:39
Visual Studio Code fish shell shortcut

Put this in your config.fish

run

code path/to/project

Tutorial to ramda-cli, a jq-like JSON processor for command-line

In this tutorial we'll use ramda-cli with [GitHub's Repos API][gh-repos-api] to get a list of @jeresig's most starred repos.

[ramda-cli][ramda-cli] is a command-line tool for processing JSON using functional pipelines. As the name suggests, its utility comes from [Ramda][ramda] and [the wide array of functions][ramda-docs] it provides for operating on lists and collections of objects. It also employs

@grillermo
grillermo / .vimrc
Created March 6, 2015 17:50
Ctrlp using ag the silver searcher
"" The Silver Searcher
if executable('ag')
" Use ag over grep
set grepprg=ag\ --nogroup\ --nocolor
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
" " ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
@tam7t
tam7t / gist:86eb4793e8ecf3f55037
Last active April 14, 2022 10:57
Securing Ruby's OpenSSL

Are your Ruby HTTPS API calls secure?

Let's check:

2.0.0-p481 :001 > OpenSSL::SSL::SSLContext::DEFAULT_PARAMS
 => {:ssl_version=>"SSLv23", :verify_mode=>1, :ciphers=>"ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW", :options=>-2147482625}
2.0.0-p481 :002 > rating = JSON.parse(RestClient::Resource.new("https://www.howsmyssl.com/a/check" ).get)['rating']
 => "Bad"
@john2x
john2x / 00_destructuring.md
Last active April 23, 2024 13:18
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@maxim
maxim / rails_load_path_tips.md
Last active April 13, 2023 13:28
How to use rails load paths, app, and lib directories.

In Rails 3

NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths

If you add a dir directly under app/

Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.

If you add a dir under app/something/

@bdunn313
bdunn313 / aruba-steps-reference.md
Created December 4, 2012 02:13
Aruba Cucumber Step Definition Reference

Aruba Cucmber Step Definition Reference

This is a short list of all of Aruba's different Cucumber step definitions that are available.

Givens

  1. Given /The default aruba timeout is (\d+) seconds/
  2. Given /^I'm using a clean gemset "([^"]*)"$/
  3. Given /^a directory named "([^"]*)"$/