Skip to content

Instantly share code, notes, and snippets.

To quickly and easily remove all unwanted comments when using Sublime text, perform a search and replace (CMD, ALT & D) and enter the following. Make sure that regex search is enabled by clicking the small icon in the bottom left that looks like an astrix.

For example, to remove all HTML comments:

(?s)<!--.*?-->

search and replace with blank

Or to remove all CSS comments:

@ss81
ss81 / remove_input_number_scroll.js
Created March 4, 2020 10:27 — forked from JaisonBrooks/remove_input_number_scroll.js
Disable Input[type=number] scroll action
// Disable Mouse scrolling
$('input[type=number]').on('mousewheel',function(e){ $(this).blur(); });
// Disable keyboard scrolling
$('input[type=number]').on('keydown',function(e) {
var key = e.charCode || e.keyCode;
// Disable Up and Down Arrows on Keyboard
if(key == 38 || key == 40 ) {
e.preventDefault();
} else {
return;
@ss81
ss81 / Local PR test and merge.md
Created May 30, 2019 17:17 — forked from adam-p/Local PR test and merge.md
Testing a pull request, then merging locally; and avoiding TOCTOU

It's not immediately obvious how to pull down the code for a PR and test it locally. But it's pretty easy. (This assumes you have a remote for the main repo named upstream.)

Getting the PR code

  1. Make note of the PR number. For example, Rod's latest is PR #37: Psiphon-Labs/psiphon-tunnel-core#37

  2. Fetch the PR's pseudo-branch (or bookmark or rev pointer whatever the word is), and give it a local branch name. Here we'll name it pr37:

$ git fetch upstream pull/37/head:pr37
@ss81
ss81 / example.php
Last active August 29, 2015 14:25 — forked from Luxian/example.php
Check what nodequeues are used in views
<?php
/**
* Check what nodequeues are used in views
*
* Usage:
* drush ev "luxian_nodequeue_stats();"
*/
function luxian_nodequeue_stats() {
if (!drupal_is_cli()) {