- https://saml.github.io
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 os | |
| import argparse | |
| def main(base_dir): | |
| for p, d, f in os.walk(base_dir): | |
| d.sort(reverse=True) | |
| for x in f: | |
| print(os.path.join(p, x)) |
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 | |
| prog="supervisord" | |
| prog_bin="/var/lib/flask/venv/bin/${prog}" | |
| pidfile="/var/run/${prog}.pid" | |
| lockfile="/var/lock/subsys/${prog}" | |
| source /etc/init.d/functions | |
| start() { |
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
| <saml> delivery is being delayed | |
| <saml> i've been waiting for so many days. | |
| <saml> it's getting so cold. but i have no jacket to wear. | |
| <saml> so i ordered online. but it's being delayed. | |
| <saml> x2 | |
| <saml> then i need a hook afterwards |
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 io | |
| import tarfile | |
| import os | |
| import requests | |
| from flask import Flask, request, send_file | |
| app = Flask(__name__) | |
| def create_tarfile(urls): |
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 _s3_push(self, payload): | |
| log.info('S3 PUSH %s', payload.source_url) | |
| def _s3_push_dummy(self, payload): | |
| log.info('S3 PUSH DUMMY %s', payload.source_url) | |
| s3_push = _s3_push \ | |
| if config['AWS_ACCESS_KEY_ID'] and config['AWS_SECRET_ACCESS_KEY'] \ |
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 argparse | |
| import logging | |
| from celery import Celery | |
| from celery.utils.log import get_task_logger | |
| from flask import Flask, jsonify | |
| app = Flask(__name__) | |
| c = Celery(__name__, broker='amqp://localhost:5672//') | |
| default_logger = c.log.get_default_logger() |
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 | |
| if [[ -z ${ORIGINALGOPATH+x} ]] | |
| then | |
| ORIGINALGOPATH="$GOPATH" | |
| ORIGINALPS1="$PS1" | |
| GOPATH="${PWD}/vendor:${PWD}:$ORIGINALGOPATH" | |
| PROJDIR="${PWD##*/}" | |
| PS1="${ORIGINALPS1}GO($PROJDIR)> " | |
| echo "Activating..." |
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 logging | |
| import logging.handlers | |
| import socket | |
| log = logging.getLogger('hehehhee') | |
| handler = logging.handlers.SysLogHandler(address=('localhost', 514), socktype=socket.SOCK_STREAM) | |
| log.setLevel(logging.INFO) | |
| log.addHandler(handler) | |
| log.info('1') | |
| log.info('2') |
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
| var $aml = (function() { | |
| var me = { | |
| ajax: AJAX() | |
| }; | |
| function formURLEncode(args) { | |
| var keyVals = []; | |
| for (var key in args) { | |
| if (args.hasOwnProperty(key)) { | |
| keyVals.push(encodeURIComponent(key) + '=' + encodeURIComponent(args[key])); |
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
| Probably you have this: | |
| upstream: A---B---C | |
| origin: A | |
| \ | |
| branch: D | |
| You want to go: | |
| upstream: A---B---C | |
| origin: A---B---C |