val input = "Frank,123 Main,925-555-1943,95122"
val pattern = """.*(\d\d\d)-(\d\d\d)-(\d\d\d\d).*""".r
val pattern(part1, part2, part3) = input
val phoneTuple = (part1, part2, part3)
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
.state('order', { | |
url: "/order", | |
templateUrl: "views/" + theme_path +"/order/order.html", | |
controller: 'AdminOrderCtrl', | |
data: { pageTitle: 'Order' } | |
}) | |
.state('order.view', { | |
url: "/view/:id", | |
templateProvider: ['$timeout', '$stateParams', 'AuthService', function ($timeout, $stateParams, AuthService) { | |
return $timeout(function () { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from sqlalchemy import event | |
@event.listens_for(Model, 'after_update') | |
@event.listens_for(Model, 'after_delete') | |
@event.listens_for(Model, 'after_insert') | |
def receive_after_change(mapper, connection, target): | |
from flask import current_app | |
current_app.logger.info('Model>receive_after_change') | |
from subprocess import call | |
call("touch tmp/reload", shell=True) |
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
find . -name '*_DiskStation_*_Conflict*' | while read line; do | |
echo "Processing file '$line'" | |
mv "$line" "$(echo "$line" | sed -r 's/_DiskStation_[a-zA-Z]{3}-[0-9]{2}-[0-9]{4}-[0-9]{4}_Conflict//')" | |
done |
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
<?php | |
$http_header = array(); | |
/** | |
* Get the header info to store. | |
*/ | |
function getHeader($ch, $header) { | |
global $http_header; | |
$i = strpos($header, ':'); | |
if (!empty($i)) { |
<form name="confirm_form" method="post" action="{{ url_for('auth.process_confirm') }}" class="col-md-offset-3 col-md-6">
{{ form.hidden_tag() }}
{% if form.password %}
{{ render_field(form.password, class_='form-control', label_class='sr-only', placeholder='비밀번호', size=30, addon='fa fa-lock fa-lg',
required=True, **{'ng-model': "credentials.password", 'ng-keyup': "check_strength(credentials)"}) }}
{% endif %}
<div class="form-group" ng-if="strength_result">
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
img_io = cStringIO.StringIO() | |
app = current_app._get_current_object() | |
try: | |
#pil_img.thumbnail(tuple(size), Image.ANTIALIAS) | |
#pil_img.save(img_io, 'PNG') | |
#img_io.seek(0) | |
resized_img = pil_img.resize(tuple(size), Image.ANTIALIAS) | |
resized_img.save(img_io, 'PNG') |
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 string | |
import random | |
print string.ascii_letters | |
print string.digits | |
allow_letters = string.ascii_letters + string.digits | |
print allow_letters |
NewerOlder