Skip to content

Instantly share code, notes, and snippets.

View juanca's full-sized avatar
🐙
Taking it easy

Juan Carlos Medina juanca

🐙
Taking it easy
  • San Francisco, CA
View GitHub Profile
@juanca
juanca / github_unview_all_files.js
Created August 16, 2024 18:41
Github PR bookmarklet: Mark all files as unviewed
javascript:document.querySelectorAll('input[name="viewed"][checked]').forEach(node => node.click())
@juanca
juanca / rails.md
Last active September 20, 2024 11:17
[GUIDE] Starting a new Ruby on Rails project in docker

Bootstrap project

  1. Initialize your project folder: git init

  2. Create your project files with a ruby image:

    docker run -it -v .:/rails/<app_name> ruby:latest /bin/bash
    cd /rails/<app_name>
    gem install rails
    rails new .
    

exit

@juanca
juanca / gist:669c59f15a17e20022b8bd78b12889e6
Created October 9, 2020 18:43
github_full_width.js -- responsive github because why not?
javascript:
((n = document.getElementsByClassName('new-discussion-timeline')[0]) && (n.style['max-width'] = '90%') && false);
@juanca
juanca / pijun.rb
Created April 30, 2019 21:18
pair+juan-carlos
require 'set'
Set.new("pair".chars) + Set.new("juan".chars) - Set.new("carlos".chars)
# => #<Set: {"p", "i", "j", "u", "n"}>
@juanca
juanca / github_load_all_diffs.js
Created March 2, 2017 18:42
Github PR bookmarklet: Load all file diffs
javascript:
document.querySelectorAll('.load-diff-button').forEach(node => node.click())
@juanca
juanca / github_toggle_height_pr.js
Last active April 12, 2017 17:20
Github PR bookmarklet: button to toggle height on file diff
javascript:
document.querySelectorAll('.file').forEach(function (fileDiff) {
var div, fa;
div = document.createElement('div');
div.className = 'btn btn-sm';
div.textContent = 'TOGGLE';
div.addEventListener('click', function (event) {
const fileActions = event.target.parentElement;
const fileHeader = fileActions.parentElement;

Keybase proof

I hereby claim:

  • I am juanca on github.
  • I am juanca (https://keybase.io/juanca) on keybase.
  • I have a public key ASCDY5TXy743cj7wb0t-iit3xHJSkpN7HZ5lImMjBpTRPQo

To claim this, I am signing this object:

@juanca
juanca / sprockets-loader-pre-script.rb
Created June 19, 2016 00:08
sprockets-loader pre-script
# Script to go through all files in a specified directory (defaults to javascirpts)
# and replace all relative `require`, `require_tree` and `require_directory` paths
# as absolute paths given `app/assets/javascripts` as root
#
# This is useful for using sprockets-loader (or webpack loaders in general because there is no access
# to path related information)
require 'Pathname'
JAVASCRIPT_ROOT = Pathname.new('app/assets/javascripts/')