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 django.db import models | |
| class User(models.Model): | |
| email = models.EmailField() | |
| obj = User(email='kavirajkanagaraj@gmail.com') | |
| print(User.email) | |
| # output: AttributeError: type object 'User' has no attribute 'email' | |
| print(obj.email) |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| class EmailField(object): | |
| def __init__(self, email=None): | |
| self.email = email | |
| def __set__(self, email): | |
| self.email = email | |
| def __get__(self, email): | |
| return self.email | |
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" | |
| "log" | |
| "github.com/jinzhu/gorm" | |
| _ "github.com/lib/pq" | |
| ) |
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 email | |
| import ( | |
| "bytes" | |
| "html/template" | |
| "os" | |
| "gopkg.in/gomail.v2" | |
| ) |
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 email | |
| import ( | |
| "bytes" | |
| "html/template" | |
| "os" | |
| "gopkg.in/gomail.v2" | |
| ) |
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 email | |
| import ( | |
| "bytes" | |
| "html/template" | |
| "reflect" | |
| "testing" | |
| ) | |
| type FakeEmailSender struct { |
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 envron | |
| import ( | |
| "log" | |
| "os" | |
| ) | |
| func MustEnv(key string) (value string) { | |
| if value = os.Getenv(key); value == "" { | |
| log.Fatalf("ENV %q is not set.", 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
| package envron | |
| import ( | |
| "os" | |
| "os/exec" | |
| "testing" | |
| ) | |
| func TestMustEnv(t *testing.T) { | |
| // If env variable "TEST" is not set then fatal it |
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
| // WARNING: This command is supposed to be used only by admin | |
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "log" | |
| "code.launchyard.com/root/myserver/config" |
OlderNewer