Skip to content

Instantly share code, notes, and snippets.

View mojoaxel's full-sized avatar
🏠
Working from home

Alexander Wunschik mojoaxel

🏠
Working from home
View GitHub Profile
@gernotger
gernotger / proxy.js
Created June 21, 2011 20:51
simple Loadbalanger for NodeJS using node-http-proxy module
var fs = require('fs'),
http = require('http'),
https = require('https'),
httpProxy = require('http-proxy');
var options = {
https: {
key: fs.readFileSync('key.pem', 'utf8'),
cert: fs.readFileSync('cert.pem', 'utf8')
}
@macdonst
macdonst / video.html
Created March 28, 2012 18:17
VideoPlayer Example
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=320; user-scalable=yes" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>PhoneGap</title>
<script type="text/javascript" charset="utf-8" src="cordova-1.5.0.js"></script>
<script type="text/javascript" charset="utf-8" src="video.js"></script>
<script type="text/javascript">
@mojoaxel
mojoaxel / server.js
Last active January 23, 2016 18:23
simple static node.js webserver
var http = require("http");
var url = require("url");
var fs = require("fs");
var port = process.argv[2] || 8080;
var contentTypes = {
'ico': 'image/x-icon',
'html': 'text/html',
'js': 'application/javascript',
'json': 'application/json',
@adammw
adammw / buildnode.sh
Last active March 5, 2016 16:44
Node.js for Raspberry Pi Packaging Script
#!/bin/sh
## Node.js for Raspberry Pi Packaging Script
## =========================================
## Execute this script from within node.js git repo
## Use like this:
## ~/node/$ VERSION=v0.10.0 ./buildnode.sh
if [ -z $VERSION ]; then
echo "set the VERSION first"
exit 1
@stepheneb
stepheneb / index.html
Created August 31, 2011 16:38
D3 Example: Processing a nested json data structure with subsections
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>D3: Subselection Example</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<style type="text/css">
body {
font: 13px sans-serif;
@adammw
adammw / README.md
Created August 3, 2012 06:30
Node.js for Raspberry Pi

Node.js for Raspberry Pi

Pre-built binaries

Recent releases have been pre-built using cross-compilers and this script and are downloadable below.

If you have found these packages useful, give me a shout out on twitter: @adammw

@palimphread
palimphread / soup.io.sh
Last active July 11, 2020 21:15 — forked from fadenb/soup.io.sh
Script for downloading all images posted on a soup (soup.io)
#!/usr/bin/env bash
# Author: Mike Herwig
# Description: Script for downloading all images posted on a soup (soup.io)
#where to download from
HOST="suckup.soup.io"
#this is the regex for matching the images, you might want to update it when soup.io changes their urls
# 2017-02-14: Updated regex to catch new and old URLs
@danielpradilla
danielpradilla / index.html
Last active August 27, 2020 11:40
HTML5 skeleton
<!DOCTYPE html>
<html>
<head>
<title>title</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
</head>
<body>
<h1>Hello, world</h1>
<script src="http://code.jquery.com/jquery.js"></script>
@WickyNilliams
WickyNilliams / bind.js
Last active December 6, 2020 15:30
Super simple one-way data-binding
/**
* follows a path on the given data to retrieve a value
*
* @example
* var data = { foo : { bar : "abc" } };
* followPath(data, "foo.bar"); // "abc"
*
* @param {Object} data the object to get a value from
* @param {String} path a path to a value on the data object
* @return the value of following the path on the data object
@SirPepe
SirPepe / draft.txt
Created February 19, 2021 11:39
Grundgesetz für Web Components
Grundgesetz für Web Components
------------------------------
§ 1 Web Components sind HTML-Elemente und müssen sich wie HTML-Elemente verhalten. Sie sind kein 1:1-Ersatz für andere Komponenten-Konzepte, sondern universelle, einfach zu benutzende Erweiterungen des HTML-Vokabulars. Ihre Attribute und APIs müssen so konzipiert sein, das sie HTML-Autoren nicht überraschen. Das stellt sicher, dass Web Components universelle Plugins sind, die in jedem Browser und Framework gut funktionieren. Insbesonders zu beachten ist:
§ 1.1 Web Components müssen einen nützlichen Use Case anbieten, der allein mit HTML-Mitteln umgesetzt werden kann. JavaScript-APIs können den Funktionionsumfang einer Web Component beliebig erweitern, dürfen aber nicht zur Pflicht werden (vgl. <video>). Das stellt sicher, dass jeder Mensch, der ein bisschen HTML kann, Web Components nutzen kann.
§ 1.2 Web Components müssen Fail-Safe sein. Sie dürfen keine JavaScript-Exceptions werfen sondern müssen wie native HTML-Elemente mit jeder Art von