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 / mapper.js
Last active March 9, 2018 10:56
Mapper for vs code extension CodeMap used to outline Jest tests
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("fs");
const reg = /((^it)|(^test)|(^describe))((\.skip)|(\.only))?\(['"](.*)['"]/
const skipPrefix = '⚪️ ';
const isolatedPrefix = '🔵 ';
const descriptionIcon = 'level3';
const testIcon = 'none';
#!/bin/sh
# Maintaining
# git remote add upstream https://gist.github.com/3195465.git
# git fetch upstream
# git rebase upstream/master
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
@simon-johansson
simon-johansson / Step to take when setting up a new virtual host on Apache
Last active August 29, 2015 14:16
Step to take when setting up a new virtual host on Apache
cd /etc/apache2/sites-available/
sudo cp <SOME SIMILAR CONF> <NEW CONF>
sudo nano <NEW CONF>
sudo a2ensite <NEW CONF>
sudo service apache2 restart
@simon-johansson
simon-johansson / base.html
Created April 19, 2013 22:08
#WEBPROG #film_12 #css_static
<link rel="stylesheet" href="{{ STATIC_URL }}css.css"/>
@simon-johansson
simon-johansson / gist:5423495
Last active December 16, 2015 10:58
#WEBPROG #film_12 #mappstruktur
Blog
├── blog_app (mapp)
│   ├── __init__.py
│   ├── admin.py
│   ├── models.py
│   ├── static (mapp)
│   ├── templates (mapp)
│   │   ├── blog_post.html
│   │   └── index.html
│   ├── tests.py
@simon-johansson
simon-johansson / settings.py
Created April 19, 2013 21:45
#WEBPROG #film_12 #snutt_?
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
@simon-johansson
simon-johansson / css.css
Last active December 16, 2015 10:49
#WEBPROG #film_12 #css
*{
margin: 0px;
padding: 0px;
}
html{
width: 100%;
height: 100%;
}
body{
width: 100%;
@simon-johansson
simon-johansson / blog_post.html
Last active December 16, 2015 10:49
#WEBPROG #film_12 #snutt_7
{% extends "base.html"%}
{% block title %} {{ oneBlogPost.title|upper }} {% endblock %}
{% block content %}
<h2 class="blogPostHeading">{{ oneBlogPost.title|upper }}</h2>
<p>{{ oneBlogPost.content }}</p>
<i>Av: {{ oneBlogPost.author.first_name }} {{ oneBlogPost.author.last_name }} den {{ oneBlogPost.datetime }}</i></br></br>
@simon-johansson
simon-johansson / index.html
Last active December 16, 2015 10:49
#WEBPROG #film_12 #snutt_6
{% block content %}
{% for post in allBlogPosts reversed %}
<h2><a href="/blog-post{{ post.id }}">{{ post.title|upper }}</a></h2>
<p>{{ post.content }}</p>
<i>Av: {{ post.author.first_name }} {{ post.author.last_name }} den {{ post.datetime }}</i></br></br>
{% endfor %}
{% endblock %}
@simon-johansson
simon-johansson / index.html
Created April 19, 2013 21:03
#WEBPROG #film_12 #snutt_5
{% extends "base.html" %}