This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @brief create_fun creates pthreads from void* (*)(P*) typed functions. | |
* | |
* @param f function as void* (*)(P*) function pointer. | |
* @param p parameter as P pointer. | |
* | |
* @return possible error in thread creation, integer from pthread_create. | |
*/ | |
template <typename F, typename P> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#ifndef PRINTER_HH | |
#define PRINTER_HH | |
#include <string> | |
#include <sstream> | |
namespace { | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular = require 'angular' | |
app = angular.module 'app', [] | |
app.service 'LocalizationService', require './services/localizationservice.coffee' | |
app.directive 'tr', require './directives/localizationdirective.coffee' | |
module.exports = app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: kahvisio | |
# Required-Start: $network $local_fs $syslog | |
# Required-Stop: $network $local_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start kahvisio at boot time. | |
# Description: Enable kahvisio as a service. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef BUFFER_HH | |
#define BUFFER_HH | |
// Variadic template (C++11) std::string bufferer | |
#include <string> | |
#include <sstream> | |
namespace { | |
void _buffer(const std::stringstream&) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Naive recursive property assignment to object from a dot delimited string, e.g. | |
# | |
# assignNestedPropertyByKeyString {}, 'biz', 'foo.bar.bah' | |
# -> {foo: {bar: {bah: 'biz'}}} | |
assignNestedPropertyByKeyString = (obj, val, keyString) -> | |
_assignNestedPropertyByKeyArray = (_o, _v, _keys) -> | |
_k = _keys.splice 0, 1 | |
if _.isEmpty _keys | |
_o[_k] = _v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
from django.contrib.sessions.models import Session | |
from django.db import models | |
class UserSession(models.Model): | |
""" | |
UserSession | |
Session tracking and management inspired by Gavin Ballard: |