Add this as a snippet as described in http://docs.sublimetext.info/en/latest/extensibility/snippets.html
Also see https://gist.github.com/wolfgangmeyers/b169a86357493329035128856b842e66 for the same snippet in visual studio code.
def sex(partners): | |
for p in partners: | |
assert p is not Nun |
import random | |
sieve_scan_top = 0 | |
sieve = {} | |
def generate_sieve(top): | |
global sieve_scan_top | |
global sieve | |
if top > sieve_scan_top: | |
sieve_scan_top = top |
#!/usr/bin/env python | |
import time | |
def cachebust_script_src(line): | |
src_i = line.find("src=") | |
begin_src = src_i + 5 | |
end_src = line.find("\"", begin_src) | |
src_contents = line[begin_src:end_src] | |
parts = src_contents.split("?") | |
base_src = parts[0] |
# SSH tunnel for RDP access | |
ssh -i <key> -f -N -L3389:localhost:3389 <user>@<host> |
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl |
#!/usr/bin/env python | |
import sys | |
import os | |
# Dead simple process watcher in python. | |
# Restarts a process if and only if it dies with a non-zero exit code. | |
# Shuts down if process exits with zero. | |
if __name__ == "__main__": |
Add this as a snippet as described in http://docs.sublimetext.info/en/latest/extensibility/snippets.html
Also see https://gist.github.com/wolfgangmeyers/b169a86357493329035128856b842e66 for the same snippet in visual studio code.
Add this snippet to visual studio code as described at https://code.visualstudio.com/docs/editor/userdefinedsnippets
Also see https://gist.github.com/wolfgangmeyers/c7de046903d1fdfcf450440d62779450 for the sublime text version.
package retries | |
import "time" | |
// WithRetries will continue to attempt an operation | |
// up to the specified number of retries with an exponential | |
// backoff. If the operation is still unsuccessful | |
// after all retries are exhausted (operation returns an error), | |
// that error is returned. | |
func WithRetries(retries int, operation func() error) error { |
# borrowed from https://groups.google.com/forum/#!topic/ansible-project/V1PoNJcXV_w | |
import ansible.runner | |
import ansible.playbook | |
from ansible import callbacks | |
from ansible import utils | |
stats = callbacks.AggregateStats() | |
playbook_cb = callbacks.PlaybookCallbacks(verbose=utils.VERBOSITY) | |
runner_cb = callbacks.PlaybookRunnerCallbacks(stats, verbose=utils.VERBOSITY) |