Skip to content

Instantly share code, notes, and snippets.

View cyantarek's full-sized avatar
🏠
Working from home

Cyan Tarek cyantarek

🏠
Working from home
View GitHub Profile
import sys, re
if sys.version_info.major != 3:
raise ValueError("You must use Python 3.")
if sys.version_info.minor < 4:
raise ValueError("You must use at least Python 3.4")
if sys.version_info.minor < 6:
print("Recommended Python Version is 3.6")
test_phone_numbers = [
{{define "base"}}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="/static/css/style.css">
<link rel="stylesheet" href="/static/css/normalize.css">
<title>{{template "title" .}}</title>
</head>
<body>
{{template "base" .}}
{{define "title"}} Posts List {{end}}
{{define "content"}}
{{range .posts}}
<div class="post_wrapper">
<h2 class="title">
<a href="/posts/{{.ID}}">{{.Title}}</a>
</h2>
<p class="date">
{{template "base" .}}
{{define "title"}} New Post {{end}}
{{ define "content"}}
{{range .posts}}
<div class="post_wrapper">
<h2 class="title">
<a href="/posts/{{.ID}}">{{.Title}}</a>
</h2>
<p class="date">
func IndexController(c context.Context) {
var posts []Post
db.Order("created_at desc").Find(&posts)
ss := sess.Start(c)
auth := ss.Get("auth")
c.ViewData("posts", posts)
c.ViewData("auth", auth)
c.View("index.html")
package main
import (
"fmt"
)
type Square struct {
side float64
}
//calculator_test.go
package main
import "testing"
func TestAdd(t *testing.T) {
if result, _ := AddFunc(1,2); result != 3 {
t.Error("Test failed")
}
}
//calculator_test.go
package main
import "testing"
func TestAdd(t *testing.T) {
if result, _ := AddFunc(1,2); result != 3 {
t.Error("Test failed")
}
}
//calculator.go
package main
import "errors"
func main() {
}
func AddFunc(num ...int) (int, error) {
package main
import (
"fmt"
"time"
)
func main() {
countFruit("Apple")
countFruit("Orange")