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
| enum LanguageByLocale { | |
| af_NA = 'Afrikaans (Namibia)', | |
| af_ZA = 'Afrikaans (South Africa)', | |
| af = 'Afrikaans', | |
| ak_GH = 'Akan (Ghana)', | |
| ak = 'Akan', | |
| am_ET = 'Amharic (Ethiopia)', | |
| am = 'Amharic', | |
| ar_001 = 'Arabic (World)', | |
| ar_AE = 'Arabic (United Arab Emirates)', |
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 Comment(models.Model): | |
| comment = models.CharField(max_length=300) | |
| blogpost = models.ForeignKey(Blogpost, on_delete=models.CASCADE) | |
| commenter = models.ForeignKey(get_user_model(), on_delete=models.CASCADE) | |
| created_at = models.DateTimeField(auto_now_add=True) | |
| updated_at = models.DateTimeField(auto_now=True) | |
| parent = models.ForeignKey('self', null=True, blank=True, related_name='replies', on_delete=models.CASCADE) |
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
| <?php | |
| $servername="localhost"; | |
| $username="root"; | |
| $password=""; | |
| $dbname="raha"; | |
| $conn=mysqli_connect($servername,$username,$password,$dbname); | |
| if($conn) | |
| { | |
| if(isset($_POST['submit'])) |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Demo</title> | |
| </head> | |
| <body onload="startTheGame();"> | |
| <h1>Hello, Enter your details</h1> |
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 get_data(request, user_id, nons): | |
| customer = services.wc_api_call('customers/' + user_id).json() | |
| print(nons) | |
| print(customer) | |
| print(customer['email']) | |
| obj, created = CustomUser.objects.get_or_create(password=make_password("1234567"), | |
| is_superuser=False, | |
| username=customer['username'], | |
| first_name= customer['first_name'], | |
| last_name= customer['last_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
| <?php | |
| /** | |
| * Plugin Name: Ethis Redirect | |
| * Description: A simple plugin to send users to EthisCrowd dashboard after logging in dynamically with user id | |
| */ | |
| function redirect_user_to_db( $redirect_to, $user ) | |
| { | |
| //is there a user to check? |
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
| # view.py | |
| def get_posts(): | |
| posts = Post.objects.all() | |
| return render(request, 'post.html' {'posts' : posts}) | |
| #template | |
| {{ posts|length }} |
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
| <?php | |
| namespace App\Jobs; | |
| use App\Podcast; | |
| use App\AudioProcessor; | |
| use Illuminate\Bus\Queueable; | |
| use Illuminate\Queue\SerializesModels; | |
| use Illuminate\Queue\InteractsWithQueue; | |
| use Illuminate\Contracts\Queue\ShouldQueue; |
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
| <?php | |
| $myObject = new MyClass; | |
| $myObject->addTwoNumbers(2,4); | |
| $myObject->subtractTwoNumbers(4,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
| <?php | |
| class MyClass | |
| { | |
| use easyMath; | |
| } | |
| ?> |
NewerOlder