Skip to content

Instantly share code, notes, and snippets.

@shameen
shameen / index.html
Last active June 2, 2017 09:41
HTML5 basic template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Web Page</title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<link rel="icon" href="/favicon.ico" />
<!--jQuery, Bootstrap-->
@shameen
shameen / jQuery Context menu 'ccontext'
Created March 14, 2011 21:44
I might turn this into a new repo, but for now it's here.
<script src="http://code.jquery.com/jquery-1.5.js"></script>
<script type="text/javascript">//<!--
/* Shameen's Context Menu (referred to as 'ccontext')
* First created 14th March 2011
*
* Usage:
* -The global array 'cc' stores the links (not yet linkable though)
* -Have a ul with the id 'context' such as:
* --<ul id="context" class="context" style="display:none;position:absolute;></ul>
* -Whatever you use to call ccontext() must have an id of
@shameen
shameen / gist:1122853
Created August 3, 2011 15:07
Function to print out the contents of a MySQL table, formatted as an HTML table with classes
<?php
/*shameen.info*/
function shameen_print_table($tablename) {
$data = mysql_query('SELECT * FROM accounts');
$cols = mysql_query('SHOW COLUMNS FROM `accounts`');
print '<table id="accounts">';
print '<tr>';
while ($row = mysql_fetch_row($cols)) {
print '<th>'.$row[0].'</th>';
@shameen
shameen / navyfieldAddIDs.js
Last active June 2, 2017 09:26
modifies the navyfield components page and can output as (mostly) CSV.Use the minified js as a bookmarklet for http://www.navyfield.com/GameInfo/Components/navalgun.aspx?nation=0
/* This code is intended for use as a bookmarklet. Use "navyfieldAddIDs_min.js" below if you want to run it.
*
* This Adds IDs to the Navyfield components page, http://www.navyfield.com/GameInfo/Components/navalgun.aspx?nation=X
* where X is a number between 0 and 7.
*
* The dataget() function can be called to output all tables on the current page into an almost-CSV format (in console)
*/
/*add jquery*/
javascript:(function(a){if(!a.jQuery){var d=document,b=d.createElement('script');b.src='http://code.jquery.com/jquery.min.js';d.getElementsByTagName('head')[0].appendChild(b)}})(this);
@shameen
shameen / watch2gether_big.user.js
Last active September 1, 2020 13:07
watch2gether greasemonkey script for: Larger player, hidden (toggleable) chat, playlist moved next to player, search results more space
// ==UserScript==
// @name watch2gether big player
// @namespace shameen.info
// @version 0.9.3
// @description Larger player, hidden (toggleable) chat, playlist next to player, search results larger
// @author Shameen
// @match http://www.watch2gether.com/rooms/*
// @match https://www.watch2gether.com/rooms/*
// @downloadURL https://gist.github.com/shameen/447233b37a44bdca3356/raw/
// @require https://code.jquery.com/jquery-2.1.4.min.js
@shameen
shameen / twitchthin.user.js
Last active February 22, 2016 18:28
Twitch responsive thin mode (video above chat)
// ==UserScript==
// @name Twitch thin mode video above chat
// @namespace http://shameen.info/
// @version 0.4
// @description Puts video above chat when the window is thin (below 900px)
// @author Shameen
// @match *.twitch.tv/*
// @exclude *.twitch.tv/*/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @downloadURL https://gist.github.com/shameen/0defdade3687070d13f5/raw/81d68c9ff0cb7084ed027d7ad4eed3dd99487474/twitchthin.user.js
@shameen
shameen / variable-missing-s.regex
Last active December 6, 2017 17:40
regex: "gettext" string validation
\%\([^\(\)]+\)[^s]
@shameen
shameen / mellowads-filters
Last active January 9, 2018 19:20
whitelisting for some ads/captcha sites that are caught by overzealous rules
@@||mellowads.com/css/
@@||mellowads.com/js/
@@||mellowads.com/img/
@@||mellowads.com/fonts/
@@||mellowads.com/api/
@shameen
shameen / kendo-treeview-dotted.css
Created April 26, 2018 09:48
Kendo UI TreeView dotted styling (like Windows)
/* Kendo UI TreeView: https://demos.telerik.com/kendo-ui/treeview
* Measurements based on the default "Material" theme as of April 2018, should be easily adjustable for other themes.
*/
.k-treeview .k-item[data-expanded="true"] { overflow:hidden;position:relative; }
.k-treeview .k-item[data-expanded="true"]:before {
content:'';
position:absolute;
top:2em;
bottom:1.2em;
@shameen
shameen / monitor-$0-notification-constant.js
Last active April 1, 2021 14:12
dev tools: monitor $0 changes + notify
//This will make a desktop notification EVERY TIME the inspected element $0 changes text.
//in Google Chrome, $0 is the current element inspected in the dev tools.
var initialElem = $0;
var initialText = initialElem.innerText;
var initialVisibility = isVisible(initialElem);
function isVisible(elem) { return !(elem.offsetWidth === 0 && elem.offsetHeight === 0) }
Notification.requestPermission();
clearInterval(x);
var x = setInterval(() => {
var newText = initialElem.innerText;