Skip to content

Instantly share code, notes, and snippets.

View HendrikRoth's full-sized avatar

Hendrik Roth HendrikRoth

  • Dusseldorf, Germany
View GitHub Profile
@HendrikRoth
HendrikRoth / public-view.js
Created January 11, 2017 09:27
mithril-node-render async rewrite isomorphic app example.
import * as es6Promise from 'es6-promise'
es6Promise.polyfill()
import 'isomorphic-fetch'
import * as m from 'mithril'
export function oninit (vnode) {
return new Promise((resolve, reject) => {
vnode.attrs.title = 'Title!'
vnode.attrs.keywords = 'Mithril Node Render Server Render Example'
vnode.attrs.description = 'This is a mithril node render server rendering example.'
#!/bin/bash
### BEGIN INIT INFO
# Provides: node-red
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start or stop the node-red server
### END INIT INFO
# Can be downloaded and installed in one go by using this command
@HendrikRoth
HendrikRoth / cssobj-plugin-keyframes.js
Created November 11, 2016 11:38 — forked from futurist/cssobj-plugin-keyframes.js
cssobj-plugin-keyframes.js
const random = +new Date()
export default {
selector: function(sel) {
let match = /^\s*@keyframes (.*)$/i.exec(sel)
return match ? '@keyframes ' + match[1].trim() + random : sel
},
value: function(val, key) {
return key=='animateName' ? val + random : val
}
}
declare namespace CssObj {
interface Options {
local?: boolean | LocalOption;
cssom?: cssomOption;
plugins?: any[];
}
interface cssomOption {
frame?: any,
prefixes?: string[],
(function () {
// IndexedDB
var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.OIndexedDB || window.msIndexedDB,
IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.OIDBTransaction || window.msIDBTransaction,
dbVersion = 1.0;
// Create/open database
var request = indexedDB.open("elephantFiles", dbVersion),
db,
createObjectStore = function (dataBase) {
/**
* workflow for:
* - transpiling tsx to mithril hyperscript
* - replacing simple typed class names to cssobj's helper function res.mapClass, keep in mind to safely set this object
*/
var gulp = require('gulp')
var browserSync = require('browser-sync').create()
var ts = require('gulp-typescript')
var replace = require('gulp-replace')
@HendrikRoth
HendrikRoth / main.go
Created June 30, 2016 23:27 — forked from nmerouze/main.go
JSON-API with Go and MongoDB: Final Part
package main
import (
"encoding/json"
"log"
"net/http"
"reflect"
"time"
"github.com/gorilla/context"
@HendrikRoth
HendrikRoth / main.go
Created June 29, 2016 20:10 — forked from nmerouze/main.go
Example for "Build Your Own Web Framework in Go" articles
package main
import (
"database/sql"
"encoding/json"
"errors"
"fmt"
"log"
"net/http"
"time"
#ifndef __LINUX_COMPILER_H
#define __LINUX_COMPILER_H
#ifndef __ASSEMBLY__
#ifdef __CHECKER__
# define __user __attribute__((noderef, address_space(1)))
# define __kernel __attribute__((address_space(0)))
# define __safe __attribute__((safe))
# define __force __attribute__((force))