Skip to content

Instantly share code, notes, and snippets.

View DenisCangemi's full-sized avatar

DenisCangemi

  • Bumpware
View GitHub Profile
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'hello'
]
from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^', include('hello.urls')),
]
# hello/urls.py
from django.conf.urls import url
from helloimport views
urlpatterns = [
url(r'^$', views.HomePageView.as_view()),
]
# hello/views.py
from django.shortcuts import render
from django.views.generic import TemplateView
# Create your views here.
class HomePageView(TemplateView):
def get(self, request, **kwargs):
return render(request, 'index.html', context=None)
<!-- hello/templates/index.html -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Howdy!</title>
</head>
<body>
<h1>Howdy! I am Learning Django!</h1>
</body>
<!-- hello/templates/index.html -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!<br> I am Learning Django!</h1>
</body>
@Component({
selector: "Cerca",
moduleId: module.id,
templateUrl: "./cerca.component.html"
})
<Page >
<TabView id="tabViewContainer" class="icon" >
<StackLayout *tabItem="{title: 'Home'}">
<Home></Home>
</StackLayout>
<StackLayout *tabItem="{title: 'Cerca'}">
<Cerca></Cerca>
</StackLayout>
<StackLayout *tabItem="{title: 'Impostazioni'}">
<Impostazioni></Impostazioni>
@DenisCangemi
DenisCangemi / test.js
Last active June 30, 2019 18:21
Example of var keyword visibility
// Example of var keyword visibility
if ( true ) {
var x = 20;
}
function set() {
var x = 50;
// Write the values in the console
console.log(x); // Result : 50
@DenisCangemi
DenisCangemi / test-visibility.js
Created June 30, 2019 18:24
Example of var keyword visibility part 2
...
function set() {
var x = 50;
var y = 30;
}
// Call the set() function
set();