Skip to content

Instantly share code, notes, and snippets.

View simon-johansson's full-sized avatar

Simon Johansson simon-johansson

View GitHub Profile
@simon-johansson
simon-johansson / mobile-meta-links.html
Created December 1, 2012 11:03
HTML: Mobile Viewport
@simon-johansson
simon-johansson / .bash_profile
Last active October 13, 2015 21:58
.bash_profile: All my aliases and shortcuts
alias dropbox="cd ~/Dropbox"
alias ploj="cd ~/GD/projekt/html5/__ploj"
alias simon="cd ~/"
alias desk="cd ~/Desktop"
alias ..='cd ..'
alias ...='cd ../..'
alias open="start ."
alias lsa="ls -a"
alias tumblr="ruby tumblr-photo-downloader.rb"
@simon-johansson
simon-johansson / .git_config
Last active October 13, 2015 22:47
Git: My Git aliases and user preferences
[user]
name = Simon Johansson
email = [email protected]
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = red reverse
@simon-johansson
simon-johansson / Octopress workflow
Created January 23, 2013 22:58
Octopress: The day-to-day workflow
$rake new_post["NAME OF BLOG ARTICLE"]
#Go to the app folder source/_posts to find the new posting
#Edit the posting and then follow these steps
$rake generate
$git add .
$git commit -m "COMMIT MESSAGE"
$git push origin master
$rake deploy
import os
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(SITE_ROOT, 'templates')
"""
This fabric file makes setting up and deploying a django application much
easier to webfaction servers or your dedicated server, but it does make a
few assumptions. Namely that you're using Git, Apache and mod_wsgi. Also
you should have SSH installed on both the local machine and any servers you
want to deploy to.
Thanks to:
http://github.com/ryanmark/django-project-templates
@simon-johansson
simon-johansson / settings.py
Last active December 14, 2015 14:29
#WEBPROG #film_3 #snutt_1
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'database.db',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
@simon-johansson
simon-johansson / views.py
Last active December 14, 2015 15:29
#WEBPROG #film_4 #snutt_1
# -*- coding:UTF-8 -*-
from django.shortcuts import HttpResponse
def oneView(request):
return HttpResponse("Hello World, from oneView", content_type="text/plain")
def anotherView(request):
return HttpResponse("Hello Again, from anotherView", content_type="text/plain")
@simon-johansson
simon-johansson / urls.py
Last active December 14, 2015 15:29
#WEBPROG #film_5 #snutt_5
from blog_app.views import oneView, anotherView