Skip to content

Instantly share code, notes, and snippets.

View meg-gutshall's full-sized avatar
💭
"Work is love made visible."

Meg Gutshall meg-gutshall

💭
"Work is love made visible."
View GitHub Profile
@andynu
andynu / example.sh
Last active January 19, 2023 16:40
rails-upgrade script, a helper for moving pins and doing other checks during ruby upgrades
# I have lots of projects. As I do the rails upgrades I collect the pin changes and other adjustments here
# towards the end of upgrading all the projects it gets easier and easier because of these commands.
❯ ./rails-upgrade
Commands:
rails-upgrade apple_touch # add blank apple-touch icons
rails-upgrade application_record # adds ApplicationRecord and replaces all references to ActiveRecord::Base with it
rails-upgrade asset_precompile_check # look for assets that need to be added to the assets initializer precompile list
rails-upgrade assigns_check # the assigns method has been extracted to a gem, check if it is used, and add the gem
rails-upgrade before_filter # change before_filter to before_action in controllers
@usayamadx
usayamadx / ExportKindle.js
Last active June 30, 2024 21:48 — forked from jkubecki/ExportKindle.js
Amazon Kindle Export
// init
let xhr = new XMLHttpRequest()
let domain = 'https://read.amazon.com/'
let items = []
let csvData = ""
// function
function getItemsList(paginationToken = null) {
let url = domain + 'kindle-library/search?query=&libraryType=BOOKS' + ( paginationToken ? '&paginationToken=' + paginationToken : '' ) + '&sortType=recency&querySize=50'
xhr.open('GET', url, false)
@wesbos
wesbos / fake.js
Created September 16, 2020 15:26
fake-your-git-history.js
let currentColor = '#ebedf0';
let clicking = false;
const boxes = document.querySelectorAll('.js-calendar-graph-svg rect');
const graph = document.querySelector('.js-calendar-graph-svg');
// code for switching the current color
function handleColorChange(e) {
const el = e.currentTarget;
currentColor = el.style['background-color'];
console.log(currentColor)
@boddhisattva
boddhisattva / setup_system_tests_with_rspec_devise_rails6.md
Last active November 9, 2023 20:58
Setup System tests to work with RSpec, Devise and Rails 6

Setting this up took quite a bit of time and research for me, so just thought of sharing the learnings along the way that led to a working setup.

  • Initial error that I was getting with running System tests in Rails 6

    System test integration requires Rails >= 5.1 and has a hard dependency on a webserver and `capybara`, please add capybara to your Gemfile and configure a webserver (e.g. `Capybara.server = :webrick`) before attempting to use system tests.
    • since the error above says specify Capybara in the Gemfile, a part of my Gemfile looked like below:
@chantastic
chantastic / on-jsx.markdown
Last active May 30, 2024 13:11
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@dwayne
dwayne / .gemrc
Last active July 28, 2021 20:04
Keep track of my setup for Ruby and Rails tools
install: --no-document # See http://guides.rubygems.org/command-reference/#gem-install
update: --no-document # See http://guides.rubygems.org/command-reference/#gem-update
:backtrace: true
@alexhawkins
alexhawkins / nativeJavaScript.js
Last active April 28, 2024 08:52
Implementation of Native JavaScript Methods (forEach, Map, Filter, Reduce, Every, Some)
'use strict';
/*****************NATIVE forEACH*********************/
Array.prototype.myEach = function(callback) {
for (var i = 0; i < this.length; i++)
callback(this[i], i, this);
};
//tests
@lfender6445
lfender6445 / gist:9919357
Last active July 3, 2024 20:50
Pry Cheat Sheet

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger