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:

@Kimtaro
Kimtaro / [TextMate] Split Windows.scpt
Created March 9, 2016 09:25
Split windows in TextMate
set dock_position to do shell script "defaults read com.apple.dock orientation"
tell application "System Events" to tell process "Dock"
set dock_dimensions to size in list 1
set dock_width to item 1 of dock_dimensions
set dock_height to item 2 of dock_dimensions
end tell
tell application "Finder"
set the_bounds to bounds of window of desktop
@Luxian
Luxian / example.php
Created January 13, 2015 17:03
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()) {
@trusktr
trusktr / DefaultKeyBinding.dict
Last active June 26, 2024 10:06
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@sindresorhus
sindresorhus / post-merge
Last active May 2, 2024 03:18
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@lihan
lihan / gist:5220679
Created March 22, 2013 11:44
Django requirements.txt
django
django-secure
django-model-utils
psycopg2
django-debug-toolbar
South
django-redis-cache
django-waffle
requests
@laychopy
laychopy / Django Apps
Last active December 11, 2015 09:18 — forked from caiges/Django Apps
Esta son aplicaciones de django muy utiles, para como dice la filosofia de Instagram no reinventar la rueda :).
django-mingus
django-ratings
django-ajax-validation
django-google-analytics
@level09
level09 / gist:3818159
Created October 2, 2012 10:55
Essential Libraries for python
django
django-celery
django-redis
django-redis-cache
django-redis-sessions
mysql-python
fabric
pil
scrapy
@sgergely
sgergely / gist:3793166
Created September 27, 2012 09:43
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@mrconnerton
mrconnerton / gist:1979037
Last active December 4, 2018 15:13
node form in ctools modal drupal 7
<?php
/*
Make Sure you include:
ctools_include('modal');
ctools_modal_add_js();
On the pages you put your link.
*/