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
[ | |
{ "keys": ["shift+enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line.sublime-macro"} }, | |
{ "keys": ["alt+up"], "command": "swap_line_up" }, | |
{ "keys": ["alt+down"], "command": "swap_line_down" }, | |
{ "keys": ["ctrl+shift+j"], "command": "join_lines" }, | |
{ "keys": ["super+alt+down"], "command": "duplicate_line" }, | |
{ "keys": ["shift+super+r"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} }, | |
{ "keys": ["super+shift+s"], "command": "save_all" }, | |
{ "keys": ["super+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} }, | |
{ "keys": ["super+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} } |
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 numpy as np | |
import pylab as pl | |
x = np.random.uniform(1, 100, 1000) | |
y = np.log(x) + np.random.normal(0, .3, 1000) | |
pl.scatter(x, y, s=1, label="log(x) with noise") | |
pl.plot(np.arange(1, 100), np.log(np.arange(1, 100)), c="b", label="log(x) true function") | |
pl.xlabel("x") | |
pl.ylabel("f(x) = log(x)") |
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
"Customize Flask to select a template based on some criteria." | |
import os | |
from flask import Flask, request, render_template | |
from flask.helpers import locked_cached_property | |
from jinja2 import FileSystemLoader, TemplateNotFound | |
# Import a detection utility from your project, not defined here. | |
# Takes a request object and returns True if browser is mobile. |
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
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} }, | |
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} } |
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/sh | |
# Install and compile Caffe on NVIDIA Jetson TK1 Development Kit | |
sudo add-apt-repository universe | |
sudo apt-get update | |
sudo apt-get install libprotobuf-dev protobuf-compiler gfortran \ | |
libboost-dev cmake libleveldb-dev libsnappy-dev \ | |
libboost-thread-dev libboost-system-dev \ | |
libatlas-base-dev libhdf5-serial-dev libgflags-dev \ | |
libgoogle-glog-dev liblmdb-dev -y |
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
# file: /etc/nginx/sites-available/example.com | |
# nginx configuration for example.com | |
server { | |
listen 80; | |
server_name example.com; | |
access_log /srv/www/example.com/logs/access.log; | |
error_log /srv/www/example.com/logs/error.log; | |
# pass root to django |
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
upstream thumborbe { | |
server thumbor.myhost.com:8090 ; | |
server thumbor.myhost.com:8091 ; | |
server thumbor.myhost.com:8092 ; | |
server thumbor.myhost.com:8093 ; | |
server thumbor.myhost.com:8094 ; | |
server thumbor.myhost.com:8095 ; | |
} | |
location ~* "^/.{28}/.*(jpg|jpeg|gif|png)(#.*)?$" { |
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/sh | |
# setup ~/.pgpass to allow passwordless connection to postgres | |
# keep last 30 executions for each job | |
KEEP=30 | |
cd /var/lib/rundeck/logs/rundeck | |
JOBS=`find . -maxdepth 3 -path "*/job/*" -type d` |
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/bash | |
# herein we backup our indexes! this script should run at like 6pm or something, after logstash | |
# rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas, | |
# compress the data files, create a restore script, and push it all up to S3. | |
TODAY=`date +"%Y.%m.%d"` | |
INDEXNAME="logstash-$TODAY" # this had better match the index name in ES | |
INDEXDIR="/usr/local/elasticsearch/data/logstash/nodes/0/indices/" | |
BACKUPCMD="/usr/local/backupTools/s3cmd --config=/usr/local/backupTools/s3cfg put" | |
BACKUPDIR="/mnt/es-backups/" | |
YEARMONTH=`date +"%Y-%m"` |
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
Show hidden characters
[ | |
{ "keys": ["f12"], "command": "htmlprettify"}, | |
{ "keys": ["f1"], "command": "fold" }, | |
{ "keys": ["f2"], "command": "unfold" }, | |
{ "keys": ["ctrl+à"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} }, | |
{ "keys": ["ctrl+!"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} }, | |
{ "keys": ["ctrl+space"], "command": "auto_complete" }, | |
{ "keys": ["ctrl+space"], "command": "replace_completion_with_auto_complete", "context": | |
[ | |
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" }, |
OlderNewer