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
const _ = require('underscore');
const studentCoursePairs1 = [
['58', 'Linear Algebra'],
['94', 'Art History'],
['94', 'Operating Systems'],
['17', 'Software Design'],
['58', 'Mechanics'],
['58', 'Economics'],
['17', 'Linear Algebra'],
@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"}>
if [ ! $(command -v brew) ]; then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
brew update
brew doctor
declare -a brew_apps=(
node
yarn
@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/')