These rules are adopted from the AngularJS commit conventions.
This file contains hidden or 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
#!/usr/bin/env python3 | |
""" | |
So far only tested on python3 interpreter. | |
Given an address, this script outputs a google maps url to the address. | |
""" | |
import requests, sys, time | |
from urllib.parse import quote_plus |
This file contains hidden or 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
# shortform git commands | |
alias g='git' | |
# git remote all remotes except origin | |
git remote -v | grep "(fetch)" | sed -e 's#[[:blank:]].*##g' | grep -v "origin" | xargs -n 1 git remote rm | |
# print all git repos for a user | |
curl -s https://api.github.com/users/wordpress/repos?per_page=1000 | grep git_url |awk '{print $2}'| sed 's/"\(.*\)",/\1/' | |
# print all git repos for a user |
This file contains hidden or 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
#!/usr/bin/env bash | |
PROCESSOR_COUNT=$(nproc) | |
GUNICORN_WORKER_COUNT=$(( PROCESSOR_COUNT * 2 + 1 )) | |
gunicorn -w ${GUNICORN_WORKER_COUNT} -b 0.0.0.0:9808 app:application |
This file contains hidden or 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
#! C:\python2.7 | |
# -*- coding: utf-8 -*- | |
# Написать декоратор мемоизирующий мат-функцию. | |
def cache(func): | |
""" | |
инициализируем словарь, ключем которого будет | |
переданный аргумент функции | |
""" | |
cache_all = {} | |
cache_all[func] = {} |
This file contains hidden or 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
# nuke the queue | |
redis-cli FLUSHALL | |
# nuke anything currently running | |
pkill -9 celeryd | |
This file contains hidden or 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 | |
NAME="hello_app" # Name of the application | |
DJANGODIR=/webapps/hello_django/hello # Django project directory | |
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket | |
USER=hello # the user to run as | |
GROUP=webapps # the group to run as | |
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn | |
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use | |
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name |
This file contains hidden or 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 upstream-apache2 { | |
server 127.0.0.1:8080; | |
} | |
upstream upstream-nodejs { | |
server 127.0.0.1:3000; | |
} | |
server { | |
listen 80; |
Setup One: Buy a Mac if you don't have one.
Setup Two: Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Setup Three: