Skip to content

Instantly share code, notes, and snippets.

View anasnakawa's full-sized avatar
💭
I may be slow to respond.

Anas Nakawa anasnakawa

💭
I may be slow to respond.
View GitHub Profile
var elementToCheck;
var DELAY = 200;
function checker() {
elementToCheck = document.querySelector('#spoAppComponent');
if(elementToCheck != null) {
putBreakPoint();
return;
}
// otherwise, keep listening
/**
* when you open https://status.aws.amazon.com/, trying to find what went wrong on a specific day,
* it can become hard to notice the blue & yellow circles among thousands of green check marks
* open the developer tools, and add the following css, and you'll only see errors
*/
/* hide green mark */
img[src*="/images/status0.gif"],
/* hide disabled (-) mark */
img[src*="status-disabled.gif"] {
/**
* acceps colors as arguments, and will simply print them out to console
*
* e.g: console.color('red', 'blue', 'green'); // prints red, blue and green squares
*/
console.color = function() {
var result = '';
var args = [];
for(var i = 0; i < arguments.length; i++) {
result += '%c ' + arguments[i] + ' ';
<script type="text/javascript">
(function() {
'use strict';
/**
* configurations
*/
var tickersClass = 'my-paused-text-shows';
@anasnakawa
anasnakawa / rotate-tabs.html
Created June 14, 2018 12:53
snippet when it will be added to the page, it will rotate tabs every few seconds
<script type="text/javascript">
(function() {
'use strict';
/**
* configurations
*/
var tabsClass = 'my-rotating-tabs'; // <- put the css class of the tabs you want to control
@anasnakawa
anasnakawa / pause-ticker.html
Last active June 14, 2018 12:13
snippet when it will be added to the page, it will pause one or more tickers shortpoint elements
<script type="text/javascript">
(function() {
'use strict';
/**
* configurations
*/
var tickersClass = 'my-paused-ticker';
@anasnakawa
anasnakawa / load-twitter-in-tabs.html
Last active June 12, 2018 20:52
script to load twitter timeline if its been added inside a shortpoint tab element
<script type="text/javascript">
(function() {
'use strict';
var sTwitterScriptID = 'shortpoint-twitter-script';
/**
* hook method to be executed as soon as shortpoint
* is available in the page
@anasnakawa
anasnakawa / hide-side-nav.css
Last active April 10, 2018 15:10
hiding side navigation box on SharePoint root site homepage
/* only on root site homepage, hide the side nav box */
[data-root-home=true] #sideNavBox {
display: none !important;
}
<script type="text/javascript">
(function() {
'use strict';
/**
* hook method to be executed as soon as shortpoint
* rendered on the page
*/
function ShortPointReady() {