Skip to content

Instantly share code, notes, and snippets.

View israelcrux's full-sized avatar

Israel Cruz israelcrux

View GitHub Profile
@israelcrux
israelcrux / Editor shortcuts.md
Last active July 16, 2020 21:27
Useful shortcuts for Sublime, Atom, VS Code and PHPStorm

Search a file by name

  • Sublime : Cmmd P
  • Atom : Cmmd P
  • VS Code : Cmmd P
  • JetBrains: Cmmd Shift O

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

(function(){
angular.module('app.directives')
.directive('focusWhen', focusWhen);
function focusWhen(){
var directive = {};
directive.link = link;
directive.scope = {
focus_event : '=focusWhen'
@israelcrux
israelcrux / in_view_after_scroll.directive.js
Created January 6, 2017 02:01
Trigger an event when element is in visible part of scrollable container. Angularjs 1.+ directive
/**
*
* Ever wanted to do something when an element comes handy in the visible part of
* a scrollabel list?
*
* Usage:
*
* <div class="list">
* <div
* in-view-after-scroll="doThisWhenThisElementIsVisibleAfterScrolling()" >
@israelcrux
israelcrux / save-and-restore-contenteditable-selection.js
Last active January 14, 2024 13:58
Save and Restore DOM text selection
function saveSelection() {
if (window.getSelection) {
var sel = window.getSelection();
if (sel.getRangeAt && sel.rangeCount) {
return sel.getRangeAt(0);
}
} else if (document.selection && document.selection.createRange) {
return document.selection.createRange();
}
return null;
@israelcrux
israelcrux / amuse-israel.zsh-theme
Created October 6, 2016 07:47
My personal ohmyzsh teme (stolen from "amuse")
# vim:ft=zsh ts=2 sw=2 sts=2
rvm_current() {
rvm current 2>/dev/null
}
rbenv_version() {
rbenv version 2>/dev/null | awk '{print $1}'
}
@israelcrux
israelcrux / A.markdown
Created October 6, 2016 06:32 — forked from umpirsky/A.markdown
Sublime Text Monokai Sidebar Theme.
@israelcrux
israelcrux / gist:cc5a732065ece92c6109
Created May 29, 2015 23:50
Snap plugin for showing grids on loaded SVGs
Snap.plugin( function( Snap, Element, Paper, global ) {
Element.prototype.showGrid = function(step) {
var w = Math.floor(this.getBBox().width),
h = Math.floor(this.getBBox().height);
console.log('showing grid step '+step+' '+w+' x '+h);
var attrs = { stroke: '#777', 'strokeWidth': 1, 'opacity': 0.7 };