Skip to content

Instantly share code, notes, and snippets.

View magicznyleszek's full-sized avatar
🤦‍♂️
Watching my hand

Leszek Pietrzak magicznyleszek

🤦‍♂️
Watching my hand
View GitHub Profile
@magicznyleszek
magicznyleszek / debugging-angularjs-from-console.md
Last active March 18, 2016 14:05
Debugging AngularJS from console

Debugging AngularJS from console

Note: In Chrome Console, instead of document.querySelector, you can use $0 - $4 to access the last 5 DOM elements selected in the inspector window.

Access Scopes

var fooCtrl = angular.element(document.querySelector('[ng-controller*="fooCtrl"]')).scope();
@w33ble
w33ble / dbprune.js
Last active January 12, 2018 17:40
Pruning Dickbars - Bookmarklet Code
// version 4-2017.18
(function dbprune() {
// restore page scrolling
var body = document.body;
var html = body.parentElement;
body.style['overflow'] = body.style['overflow-y'] = 'auto';
html.style['overflow'] = html.style['overflow-y'] = 'auto';
// check if this is a mobile display
var mHeight = 680;
@xfateless
xfateless / color object
Last active January 3, 2022 07:28
Every color contained in an object with its corresponding hexa value for O(1) time lookup, find function below object
var colors = {
ALICEBLUE: '#F0F8FF',
ANTIQUEWHITE: '#FAEBD7',
AQUA: '#00FFFF',
AQUAMARINE: '#7FFFD4',
AZURE: '#F0FFFF',
BEIGE: '#F5F5DC',
BISQUE: '#FFE4C4',
BLACK: '#000000',
BLANCHEDALMOND: '#FFEBCD',