Skip to content

Instantly share code, notes, and snippets.

View daBayrus's full-sized avatar
🍜

라가나 조엘 daBayrus

🍜
View GitHub Profile
Change a devise app from scratch
video link here: https://drive.google.com/file/d/1S59pmFe-Cp_s8aJLMax296x4AN0x0naK/view?usp=sharing
Add these Gems to your Gemfile
gem 'omniauth-oktaoauth'
gem 'activerecord-session_store'
@singledigit
singledigit / cognito.yaml
Last active June 4, 2024 05:19
Create a Cognito Authentication Backend via CloudFormation
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Parameters:
AuthName:
Type: String
Description: Unique Auth Name for Cognito Resources
Resources:
# Creates a role that allows Cognito to send SNS messages
SNSRole:
@ljharb
ljharb / array_iteration_thoughts.md
Last active May 22, 2024 09:22
Array iteration methods summarized

Array Iteration

https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it mu

@bishboria
bishboria / springer-free-maths-books.md
Last active June 8, 2024 06:39
Springer made a bunch of books available for free, these were the direct links
@normancapule
normancapule / Notes
Last active October 14, 2015 11:27
How we deal with TIMEZONES!
1. User.timezone comes from momentjs moment().format("Z")
2. Everytime user logs in, we pass the browser's timezone
3. Session controller updates user timezone
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@siawyoung
siawyoung / post_to_slack.rb
Created March 16, 2015 04:39
Script for posting to Slack's incoming webhooks
require 'json'
require 'optparse'
require 'net/http'
require 'net/https'
def parse_options(argv)
#######################################
# Please change the following as needed
#######################################
@arnaudbreton
arnaudbreton / rsync-auto grunt alternative.coffee
Last active March 25, 2020 04:45
Gruntfile to trigger new Vagrant 1.5 rsync command when catching changes. Faster than Vagrant rsync-auto bundled command, mainly because Grunt only watches specified paths while Guard/Listen (used internally by Vagrant) watches the whole (sub)-folders.
terminal = require('color-terminal')
log = (error, stdout, stderr, cb) ->
if error
terminal.color('red').write stdout
else
terminal.color('green').write stdout
cb()
@normancapule
normancapule / deploy.rb
Created March 5, 2014 13:50
Sample Capistrano 3.1 Config
# config valid only for Capistrano 3.1
lock '3.1.0'
set :application, '<application_name>'
set :repo_url, '<url.git>'
set :deploy_via, :remote_cache
# Default branch is :master
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
@favadi
favadi / redmine.conf
Last active January 18, 2020 01:59
Manage redmine with unicorn, rbenv and supervisord
[program:redmine]
command=/home/redmine/start_redmine.sh
user=redmine
directory=/home/redmine
stderr_logfile=/var/log/supervisor/redmine_error.log
stdout_logfile=/var/log/supervisor/redmine_out.log
environment=HOME="/home/redmine"