Skip to content

Instantly share code, notes, and snippets.

View wemakeweb's full-sized avatar
🚀
Scaling Ampeers

Sebastian Otto wemakeweb

🚀
Scaling Ampeers
View GitHub Profile
@wemakeweb
wemakeweb / clockingIt.css
Created November 18, 2010 17:58
clockingIt - simple & cleam
/* for firefox stylish addon */
.content_body{
border:1px solid rgba(0,0,0,0.15);
padding-top: 1px !important;
padding-left:1px;
}
#main-table{
padding-top:5px;
}
#globalMenu {background:none !important; border:none !important}
function encode(messages){
var ret = '', message,
messages = io.util.isArray(messages) ? messages : [messages];
for (var i = 0, l = messages.length; i < l; i++){
message = messages[i] === null || messages[i] === undefined ? '' : stringify(messages[i]);
ret += frame + message.length + frame + message;
}
return ret;
};
@wemakeweb
wemakeweb / bildschirm.css
Created April 18, 2011 11:49
überarbeitete Version
/*
1. Reset
http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
@wemakeweb
wemakeweb / sample.php
Created May 4, 2011 18:11
php <-> db
<?php
/* Verbindung aufbauen */
$verbindung = mysql_connect ("Servername", "Username", "Passwort")
/* wenn keine Verbindung möglich ist, error ausgeben */
or die ("keine Verbindung möglich. Benutzername oder Passwort sind falsch");
/* Datenbank auswählen, auf die du zugreifen willst */
mysql_select_db("Datenbankenname") or die ("Die Datenbank existiert nicht.");
?>
var fs = require('fs'),
tls = require('tls'),
net = require('net'),
server = {
key: fs.readFileSync('../server-key.pem'),
cert: fs.readFileSync('../server-cert.pem'),
},
socket;
try {
import java.util.Calendar;
public class Datum {
private int day;
private int month;
private int year;
public Datum(){
this.setDefault();
}
new Ressource({
output : document.getElementById('to'),
item : {
name : {
type : 'text',
required : true,
style : {
width: '100px',
height: '100px'
}
@wemakeweb
wemakeweb / Filehandler.js
Created January 5, 2012 19:12
key shared values store
module.exports = (function (o) {
//the actual object
var cache = {};
function Filehandler (o) {
if (!o.deleter || !o.loader) {
throw new Error("Delete or Load callback was not passed");
}
this.loader = o.loader;
@wemakeweb
wemakeweb / gist:1596135
Created January 11, 2012 18:46
Oberklasse.setBuchung.java
public void setBuchung(Datum buchungsdatum, int naechte, Datum heute,String name,int preis) throws BuchungÜberschneidetSich{
Buchung wunsch = new Buchung(buchungsdatum, naechte);
wunsch.setpreis(preis);
wunsch.setname(name);
if (buchungsListe.size() != 0) {
for (int i = 0; i < buchungsListe.size(); i++) {
@wemakeweb
wemakeweb / measureTextHeight.js
Created January 31, 2012 03:33
measures the Height of a given Text
function measureTextHeight(text, width, font, lineHeight) {
var ctx = document.createElement("canvas").getContext("2d"),
lines;
ctx.font = font;
lines = Math.round(ctx.measureText(text).width / width);
return {
lines: lines,
height: lines * lineHeight