brew update
brew install pyenv
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
body.swagger-body { | |
background: #3b4151; | |
} | |
h1, h2, h3, h4, h5, h6, pre {color: #fff!important;} | |
.swagger-ui .scheme-container { | |
background: #3b4151; | |
} |
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 threading | |
from .models import Crawl | |
def startCrawl(request): | |
task = Crawl() | |
task.save() | |
t = threading.Thread(target=doCrawl,args=[task.id],daemon=True) | |
t.start() | |
return JsonResponse({'id':task.id}) |
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
// Usage: | |
// | |
// colorShader(10, '#f50'); // brighten color 10% | |
// colorShader(-10, '#f50'); // darken color 10% | |
// | |
// colorShader(10, '#f50', '#0ad74e'); // blend two colors | |
// colorShader(10, 'rgb(210, 200, 20)', 'rgb(20,156,210)'); // blend two colors | |
const colorShader = (ratio=10, color1, color2 = false) => { | |
let p = ratio / 100; |
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
ps -ylC apache2 | awk '{x += $8;y += 1} END {print "Apache Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}' |
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
class PostAdmin(CssClassMixin, admin.ModelAdmin): | |
form_css_clasess = { | |
'title': 'col-sm-8', | |
'slug': 'col-sm-12' | |
} |
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 django-storages app with pip | |
# $ pip install django-storages | |
# | |
INSTALLED_APPS = ( | |
... | |
'storages', | |
... | |
) |
sqlite3 databse.db .dump > sqlite3_database_dump.sql
python sqlite3_to_mysql.py database.sql > mysql_database_dump.sql
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
<html> | |
<head> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css"> | |
<link href="https://fonts.googleapis.com/css?family=Raleway:100,200,300" rel="stylesheet"> | |
<style> | |
body { | |
background-image: url("http://static.simpledesktops.com/uploads/desktops/2014/10/15/tetons-at-night.png"); | |
background-size: cover; | |
color: rgba(255,255,255,.5); |
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
############################ | |
# TRY LINE 33 and 34 BEFORE RUN THIS !!!! | |
############################ | |
mysqldump --all-databases > /tmp/all.mysql.dump.sql | |
ps -ax | grep mysql | |
# stop and kill any MySQL processes | |
brew remove mysql |
NewerOlder