Skip to content

Instantly share code, notes, and snippets.

View dhilst's full-sized avatar
😻

Daniel Hilst dhilst

😻
View GitHub Profile
from jinja2 import Template
from jinja2.runtime import Context
from jinja2.exceptions import UndefinedError
def merge_vars(obj):
d = {}
for o in reversed(obj.mro()):
d.update(vars(o))
return d
py3 pass
syntax on
set background=dark
set laststatus=2
set smartindent
set autoindent
set modeline
set nocompatible
" execute pathogen#infect()
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
var module = angular.module('HelloWorldApp', []);
module.controller('HelloWorldController', function($scope){
$scope.name = "";
$scope.greeting = "World"
$scope.setName = function(){
$scope.greeting = $scope.name.toUpperCase();
};
})
"""hellworldproj URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
"""
Django settings for hellworldproj project.
Generated by 'django-admin startproject' using Django 2.0.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
" vim use the first python interpreter that is
" loaded. This force it to load python3 :-)
py3 pass
" fish shell is not posix. This leads to errors
" while VundleInstall. This fix it
set shell=bash
syntax on
set background=dark
const vm = require('vm');
var data = [];
process.stdin.setEncoding('utf8');
process.stdin.on('readable', () => {
const chunk = process.stdin.read();
if (chunk !== null) {
data.push(chunk);
}
});
process.stdin.on('end', () => {
const foo = new Promise((resolve,reject) => {
const failed = Math.random() > 0.5;
setTimeout(data => {
if (failed) {
reject(data);
} else {
resolve(data);
}
})
});
➜ ~ gdbus call -y -d org.freedesktop.systemd1 -o /org/freedesktop/systemd1 -m org.freedesktop.systemd1.Manager.ListUnitsFiltered task
Error parsing parameter 1 of type 'as': unknown keyword:
task
^^^^