I hereby claim:
- I am gildean on github.
- I am o_k (https://keybase.io/o_k) on keybase.
- I have a public key whose fingerprint is 1EE9 07C7 50B6 BDF3 27D8 7134 4C4B 6D7F 5184 9FAB
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#! /bin/bash | |
if ! oc whoami &> /dev/null; then echo "login to oc first" && exit 1; fi | |
set -euo pipefail | |
TOKEN=$(oc whoami -t) | |
API_SERVER_ADDRESS="https://master/api/v1/watch/events" | |
# setting LANG gives correct timestamps | |
LANG=fi_FI.UTF-8 | |
# print timestamp in the middle of the row every 60s | |
while sleep 60; do |
oc new-build --binary=true --name=ola2 --image-stream=redhat-openjdk18-openshift
oc start-build ola2 --from-file=./target/ola.jar --follow
oc new-app
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, user-scalable=no"> | |
<title>WebSocketTest</title> | |
<style> | |
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 300; src: local('Lato Light'), local('Lato-Light'), url(http://themes.googleusercontent.com/static/fonts/lato/v6/KT3KS9Aol4WfR6Vas8kNcg.woff) format('woff'); } | |
body { font: 130% 'Lato', sans-serif; color:#34495e; background: #ecf0f1; text-shadow: -1px 1px 1px rgba(0,0,0,0.3); padding: 1em 2em; } | |
#status { position: fixed; top: 0.2em; right: 0.5em } |
var net = require('net'); | |
var server = require('http').createServer(app).listen(8000); | |
function app(req, res) { | |
if (req.url === '/') { | |
res.writeHead(200, {'Content-Type': 'video/webm'}); | |
var socket = new net.Socket(); | |
socket.connect(5000, 'localhost').pipe(res); | |
} else { | |
res.statusCode = 404; |
var express = require('express'), | |
app = express(), | |
server = require('http').createServer(app).listen(9999); | |
app.set('view engine', 'jade'); | |
app.set('views', __dirname + '/views'); | |
app.use(express.bodyParser()); | |
app.use(express.cookieParser()); | |
app.use(express.session({ secret: 'secret' })); | |
app.use(express.csrf()); |
!!! | |
head | |
title express-uploader | |
body | |
h1 express-uploader | |
p | |
a(href="/uploads") Uploaded files | |
p | |
form(action="/save", method="post", enctype="multipart/form-data") | |
input(type="file", name="upload") |
var connect = require('connect'); | |
var app = connect(); | |
var PeerServer = require('peer').PeerServer; | |
var peerport = 9999; | |
var httpport = 8888; | |
var peerserver = new PeerServer({ port: peerport }); | |
var server = require('http').createServer(app).listen(httpport); | |
app.use(connect.static(__dirname + '/public')); | |
app.use(function (req, res) { |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>socket.io echo</title> | |
<style> | |
body { font: 120% 'Open Sans', sans-serif; padding: 1em 2em 0; } | |
input, button { font-size: 110%; padding: 0.4em} | |
</style> | |
</head> |
function firstFunc(somevalue, callback) { | |
// pass the values, error as null (no possibility of error here) and the value is the new string | |
// this is the normal node convention | |
callback(null, somevalue += ' ok'); | |
} | |
// call the function with the string and an anon function that get's the values from the callback | |
firstFunc('this should be', function (error, callbackvalue) { | |
if (!error) { | |
// if the callback didn't pass an error, then things should be ok |