- Sublime 3
- Package Control
- Markdown highlight
- INI highlight
- Nginx highlight
- Play highlight
- Python improved
- Generic Config highlight
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
# EDITOR=nano sudo visudo | |
# Change the following line: (:i to insert + esc to go back + :w to save + :q to quit) | |
# Defaults env_reset | |
# to: | |
# Defaults env_reset,timestamp_timeout=960 # in minutes | |
export PATH=$PATH:. | |
# export PATH=$PATH:/usr/bin |
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
''' | |
MIT license: http://opensource.org/licenses/MIT | |
Copyright (c) <2013> <Paulo Cheque> | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
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
def find_seq(seq, alist): | |
''' | |
Find the sequence @seq in the list @alist. | |
@seq: a list or tuple with size `m`. | |
@alist: a list or tuple with size `n`. | |
@return: True if @alist contains @seq, False otherwise. | |
Complexity: `O((n-m) * m) = O(n * 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
import os | |
from os import listdir | |
from os.path import isfile, join | |
from invoke import run, task | |
dirpath = './mypath' | |
@task | |
def resize(): | |
#http://www.imagemagick.org/Usage/resize/#resize |
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
# -*- coding: utf-8 -*- | |
import os | |
import tempfile | |
from shutil import rmtree, copy2 | |
TEMP_PATH = tempfile.gettempdir() or os.environ.get('TEMP') | |
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
{ | |
"python": "pypy", | |
"url": "http://localhost:8000", | |
"host": "localhost", | |
"port": 8000, | |
"heroku_app": null, | |
"heroku_app_addons": [], | |
"heroku_worker": null, | |
"heroku_worker_addons": [], | |
"heroku_cedar": null, |
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
# ab -n 2000 -c 200 https://url/ | |
install_dependencies() { | |
brew install freetype | |
brew install libpng | |
brew install libevent | |
virtualenv venv --no-site-packages | |
source venv/bin/activate | |
pip install numpy | |
pip install matplotlib |
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
# You may put this on the rakelib directory or renamed it to .rb and add a 'require' command | |
MAIN_PATH = File.dirname(__FILE__) | |
module OS | |
def OS.windows? | |
(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil | |
end | |
def OS.mac? |
NewerOlder