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
1) virtualenv $name | |
2) pip install django | |
3)source bin/activate | |
4) django-admin startproject $name | |
5)django-admin startapp $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
<p> | |
<label for="email">Email</label> | |
<input type="email" ng-model="formModel.email" name="email" required="required" | |
ng-class="{green: theForm.email.$valid , | |
red: !theForm.email.$valid && !theForm.$pristine | |
}"> | |
<p class="red" ng-show="theForm.email.$error.required && !theForm.$pristine"> | |
email is required | |
</p> |
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
<p> | |
<label for="email">Email</label> | |
<input type="email" ng-model="formModel.email" name="email" required="required" | |
ng-class="{green: theForm.email.$valid , | |
red: !theForm.email.$valid && (!theForm.$pristine || theForm.$submitted) | |
}"> | |
<p class="red" ng-show="theForm.email.$error.required && !theForm.$pristine"> | |
email is required | |
</p> |
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
<p> | |
<label for="full_name">Full Name</label> | |
<!-- each form must have name and html validation --> | |
<!-- must have ng-class variable object with classes like this --> | |
<input type="text" ng-model="formModel.fullname" name="full_name" required="required" | |
ng-pattern="^[a-zA-Z][a-zA-Z0-9-_\.]{1,20}$" | |
ng-class="{ | |
green: theForm.full_name.$valid , | |
red: !theForm.full_name.$valid && !theForm.$pristine |
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
location = / { | |
[ configuration A ] | |
} | |
location / { | |
[ configuration B ] | |
} | |
location /documents/ { | |
[ configuration C ] |
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 app = angular.module(myapp,[]).config(function($interpolateProvider){ | |
$interpolateProvider.startSymbol('[[').endSymbol(']]'); | |
}); |
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
MEDIA_ROOT = os.getcwd()+'/media/' | |
THUMBNAILS = MEDIA_ROOT+"thumbnails/" | |
ct = request.FILES["file"].content_type | |
ext = file_ext(ct) | |
handle_uploaded_file(request.FILES['file'], generated_name+ext ) | |
thumbnail(MEDIA_ROOT+generated_name+ext, THUMBNAILS+generated_name+ext) |
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 spinning: Bool = false | |
var spinner = UIActivityIndicatorView() | |
@IBAction func spin(_ sender: Any) { | |
if !spinning { | |
spinner = UIActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: 200, height: 200 ) ) | |
spinner.center = self.view.center | |
spinner.hidesWhenStopped = true |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"strings" | |
"github.com/apaxa-go/eval" | |
) |
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
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
for i := 1; i <= 10; i++ { | |
fmt.Printf("%v -- %v \n", "super", "love") | |
} |
OlderNewer