- Sublime Text > Preferences > Settings :
"translate_tabs_to_spaces": [true|false]
- Sublime Text > Preferences > Settings - Syntax Specific :
"translate_tabs_to_spaces": [true|false]
- View > Indentation > Indent using spaces : toggle
- Open .editorconfig if it exists : update
indent_style = [space|tab|ignore]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.get('https://api.spartan.com/v6/api/get_page/?route=spartan.training.wod&secondary=spartan-wod&primary=1', function(data) { | |
var workoutHtml = data.wods[0].post_content; | |
workoutHtml = workoutHtml.split('jpg').join('x'); | |
workoutHtml = workoutHtml.split('png').join('x'); | |
document.write(workoutHtml); | |
$('img').hide(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
# http://docs.python-guide.org/en/latest/writing/logging/ | |
import logging | |
logger = logging.getLogger() | |
handler = logging.StreamHandler() | |
formatter = logging.Formatter( | |
'%(asctime)s %(name)-12s %(levelname)-8s %(message)s') | |
handler.setFormatter(formatter) | |
logger.addHandler(handler) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Install Box2D from source | |
# Mac | |
brew install swig | |
# Linux | |
sudo apt-get install build-essential python-dev swig | |
# Download source | |
cd ~/dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from datetime import datetime as dt | |
import numpy as np | |
def save_results(agent, arr): | |
# Save array of Q updates (or anything else) and accompanying agent metadata | |
filename = '{}_{}'.format(dt.now().strftime('%H%M%S'), agent.algo_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:((function() {document.querySelectorAll("link[rel='stylesheet']").forEach(function(l) {l.remove();});document.querySelectorAll("style").forEach(function(s) {s.remove();});})()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure("2") do |config| | |
# config.vm.box = "ubuntu/trusty64" | |
# config.vm.box = "ubuntu/xenial64" | |
# config.vm.box = "bento/ubuntu-14.04" | |
config.vm.box = "bento/ubuntu-16.04" | |
# NB: this value is used in ansible playbook and inventory. | |
config.vm.define 'ubuntu-16-vm' | |
config.vm.synced_folder '../', '/home/vagrant/src', nfs: true, mount_options: ['rw', 'vers=3', 'tcp', 'fsc' ,'actimeo=2'] | |
config.vm.synced_folder '../../', '/home/vagrant/external' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<svg></svg> | |
<script> | |
var height = 400; | |
var width = 800; | |
function fn(x) { | |
return (x * 0.1) * Math.sin(x / 8); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
https://stackoverflow.com/questions/2846653/how-to-use-threading-in-python | |
https://stackoverflow.com/questions/5442910/python-multiprocessing-pool-map-for-multiple-arguments/5443941#5443941 | |
""" | |
import itertools | |
from multiprocessing import Pool | |
def _func_run_task(x): | |
return do_task(*x) |
OlderNewer