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
| import json | |
| import sys | |
| from flask import Flask, request | |
| app = Flask(__name__) | |
| @app.route('/', methods=['POST']) |
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
| def handle_checkdigit(upc, append=False): | |
| if len(upc) not in [11, 12]: | |
| raise ValueError('Given UPC must be 11 or 12 digits') | |
| bool_mode = len(upc) == 12 | |
| if bool_mode: | |
| check_digit = upc[11] | |
| upc = [int(i) for i in upc[:11]] | |
| odd = [] |
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 | |
| function css_build { | |
| echo "Starting build..." | |
| lessc --verbose ./less/main.less ../assets/css/app.css | |
| echo "Completed at `date +%H:%I:%S`" | |
| } | |
| function css_watch { | |
| echo "Building CSS on changes (CTRL+C to stop)" |
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
| from IPython import get_ipython | |
| from IPython.terminal.prompts import Prompts, Token | |
| c = get_config() | |
| class SimplePrompt(Prompts): | |
| def in_prompt_tokens(self, cli=None): | |
| return [(Token.Prompt, '[{}] >>> '.format(self.shell.execution_count))] |
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 | |
| find . -name "$1" | |
| read -p "Do you wish to remove these files? (y/N) " yn | |
| case ${yn:0:1} in | |
| [Yy]* ) find . -name "$1" -delete;; | |
| * ) exit;; | |
| esac | |
| echo "Files have been removed" |
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
| [[source]] | |
| url = "https://pypi.org/simple" | |
| verify_ssl = true | |
| name = "pypi" | |
| [packages] | |
| django = "*" | |
| celery = "*" | |
| coverage = "*" | |
| django-rest-framework = "*" |
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
| def handle(self, *app_labels, **options): | |
| # Generate a migrations manifest with latest migration on each app | |
| super(Command, self).handle(*app_labels, **options) | |
| loader = MigrationLoader(None, ignore_no_migrations=True) | |
| with open("latest_migrations.manifest", 'w') as f: | |
| f.write("\n".join(sorted(f"{a}: {m}" for a, m in loader.graph.leaf_nodes()))) |
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
| # models.py | |
| from .tasks import send_event | |
| class Event(models.Model): | |
| is_async = models.BooleanField(default=False) | |
| # ... | |
| def _send(self): | |
| # do sending stuff |
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
| import hashlib | |
| import io | |
| import json | |
| import os | |
| from django.core.files.storage import default_storage | |
| import googlemaps |
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
| set __fish_git_prompt_showdirtystate 'yes' | |
| set __fish_git_prompt_showstashstate 'yes' | |
| set __fish_git_prompt_showuntrackedfiles 'yes' | |
| set __fish_git_prompt_showupstream 'yes' | |
| set __fish_git_prompt_color_branch yellow | |
| set __fish_git_prompt_color_upstream_ahead green | |
| set __fish_git_prompt_color_upstream_behind red | |
| set __fish_git_prompt_color_prefix white | |
| set __fish_git_prompt_color_suffix white |