Here is a list of scopes to use in Sublime Text 2/3 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
| #!/usr/bin/env bash | |
| set -e | |
| # Usage: parse_mongo_url URL | |
| # It sets the following variables: | |
| # MONGO_HOST | |
| # MONGO_PORT | |
| # MONGO_DATABASE | |
| # MONGO_USER | |
| # MONGO_PASSWORD |
| var max = 100000000 | |
| console.time('empty loop') | |
| function loop () { | |
| for (var i = 0; i < max; i++) {} | |
| } | |
| loop() |
| adb shell dumpsys battery | grep level |
| #!/bin/sh | |
| # | |
| # Automatically add branch name and branch description to every commit message except merge commit. | |
| # | |
| COMMIT_EDITMSG=$1 | |
| addBranchName() { | |
| NAME=$(git branch | grep '*' | sed 's/* //') | |
| DESCRIPTION=$(git config branch."$NAME".description) |
| // css | |
| .dialogWide > .modal-dialog { | |
| width: 80% !important; | |
| } | |
| // script | |
| bootbox.dialog({ | |
| className: "dialogWide", | |
| title: "Foo", | |
| message: "what to say, go wide", | |
| buttons: { |
| function getUrlParams(search) { | |
| const hashes = search.slice(search.indexOf('?') + 1).split('&') | |
| const params = {} | |
| hashes.map(hash => { | |
| const [key, val] = hash.split('=') | |
| params[key] = decodeURIComponent(val) | |
| }) | |
| return params | |
| } |
Here is a list of scopes to use in Sublime Text 2/3 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
| import functools | |
| def memoization(mem_dict): | |
| """ This is a version for modules' functions. | |
| :Parameter - `mem_dict` | |
| A global variable used to store the calculation result | |
| :Usage | |
| fibo_dict = {} | |
| @memoization(fibo_dict) |
| Windows Registry Editor Version 5.00 | |
| ; | |
| ; Adds 'Open in Atom' to context menu (when you right click) in Windows Explorer. | |
| ; | |
| ; Based on https://github.com/Zren/atom-windows-context-menu. It didn't work | |
| ; https://github.com/Zren/atom-windows-context-menu/issues/1. | |
| ; | |
| ; Save this file to disk with a .reg extension. Replace C:\\Atom\\atom.exe with | |
| ; the path to the atom executable on your machine. |