Skip to content

Instantly share code, notes, and snippets.

View SidIcarus's full-sized avatar

Alvaro Pareja-Lecaros SidIcarus

View GitHub Profile
@SidIcarus
SidIcarus / toast.module.js
Last active February 17, 2022 17:14
angularjs-toast
/*!
* es-module implementation of anguljar-toast by sibiraj
* @module angularjs-toast
* @description A Simple toast notification service for AngularJS pages
* @version v4.0.2
* @link https://github.com/sibiraj-s/angularjs-toast#readme
* @licence MIT License, https://opensource.org/licenses/MIT
*/
/** @param {ng.ITemplateCacheService} $templateCache */
@SidIcarus
SidIcarus / StyleObserver.js
Last active July 1, 2021 19:32
JavaScript library to observe style changes on any DOM element. For an observed element, on every computed style change returns a difference object. Allows to be imported as a module & for optional filtering by any given styles. Slightly more performant then Sauron-Style
/**
* @param {Element} node
* @returns {node is HTMLLinkElement}
*/
function isLink (node) { // @ts-ignore
return node.tagName === 'LINK' && node.rel === 'stylesheet'
}
/**
* @param {Element} node
* @returns {node is HTMLStyleElement}
@SidIcarus
SidIcarus / shits&giggles.js
Created January 29, 2020 22:55
jQuery log function decorator
function jqueryLogDecoratorInstaller () {
console.log('Decorating jQuery methods with logging');
const install = (name, oldMethod) => {
$.fn[name] = function () { // cannot be shorthand
console.log(`${this.selector}.${name}(${Array.from(arguments).toString()})`);
return oldMethod.apply(this, arguments);
};
};
@SidIcarus
SidIcarus / pliim-turnOff.scpt
Created March 23, 2019 05:42 — forked from zehfernandes/pliim-turnOff.scpt
One click and be ready to go up on stage and shine! - https://zehfernandes.github.io/pliim/
# Turn on Notifications
do shell script "defaults -currentHost write com.apple.notificationcenterui doNotDisturb -bool FALSE; defaults -currentHost delete com.apple.notificationcenterui doNotDisturbDate; osascript -e 'quit application \"NotificationCenter\" ' && killall usernoted" -- this set 'Do not disturb' to false in the pref
# Show Desktop
do shell script "defaults write com.apple.finder CreateDesktop -bool true; killall Finder"
# Show all windows
tell application "System Events"
set visible of (every process) to true
end tell
@SidIcarus
SidIcarus / README.md
Created September 14, 2018 13:48 — forked from hassansin/README.md
Remote Debugging with XDebug 2.1

XDebug

A PHP extension that allows you to:

  1. walk through your code by Remote Debugging
  2. find bottlenecks in your application by Profiling
  3. find Code Coverage in a single request
  4. trace your application by logging all function calls
@SidIcarus
SidIcarus / bucketsnip.sh
Last active June 13, 2018 18:39 — forked from mgoellnitz/bucketsnip.sh
Bitbucket Snippet Command Line Tool
#!/bin/bash
#
# Copyright 2017-2018 Martin Goellnitz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@SidIcarus
SidIcarus / Consoul.color
Last active June 6, 2018 19:45
Pretty print your console logs.
((root, factory, has, name) => {
if (!has.call(root, name)) root[name] = factory();
})(this || window, () => {
const consoleColors = {
default: "rgb(189, 198, 207)",
alert: "rgb(210, 70, 70)",
background: "rgb(64, 64, 64)",
info: "rgb(70, 140, 210)",
success: "rgb(35, 140, 35)",
warn: "rgb(225, 180, 110)"
@SidIcarus
SidIcarus / MutationObserverJS
Last active August 8, 2017 17:40
MutationObserver
/**
* Supports IE9+, FF, Webkit
* @param callback
*/
function watchElementState(callback) {
var MutationObserver =
window.MutationObserver || window.WebKitMutationObserver,
eventListenerSupported = window.addEventListener;
// callback.bind(this);
@SidIcarus
SidIcarus / bootstrap.sh
Last active November 24, 2021 00:40
environment bootstrap scripts
#!/bin/bash
# shellcheck disable=1090,1091,2059
# set ENV default value to 'dev''
ENV="${1:-dev}"
# import (source) utility variables and functions
. "$DIR/bootstrap/utils"
# Terminal output to illustrate progress

Keybase proof

I hereby claim:

  • I am SidIcarus on github.
  • I am sidicarus (https://keybase.io/sidicarus) on keybase.
  • I have a public key whose fingerprint is 5ABC 3931 D5A8 B2FE 6716 5BF4 FD62 4C69 7A63 61FE

To claim this, I am signing this object: