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
<!DOCTYPE html> | |
<html lang=nl> | |
<head> | |
<meta charset=utf-8> | |
<title>Chrome float bug</title> | |
<style> | |
.tabs ul { | |
list-style-type: none; | |
} |
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/sh | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: redis-server - Persistent key-value db |
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
var crypto = require('crypto'); | |
var origtoken = '128073137281613|2.AQDnAjjO73ESnmhJ.3611.1311634811.2-3306278|i3L2dgZ7rg6m2vKt0GzjhhKbzTQ'; | |
var algo = 'des-ecb'; // openssl list-cipher-commands to list available algos | |
var key = 'appelsap'; | |
var base = 'base64'; // changing this to 'hex' makes it work | |
var tokencrypt = crypto.createCipher(algo, key); |
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
var mysql = require('db-mysql'); | |
for (var i = 0; i < 4; ++i) { | |
new mysql.Database({ | |
hostname: hostname, | |
user : user, | |
password: password, | |
database: database | |
}).connect(function() { | |
this.query('SELECT SLEEP(10)').execute(function() { |
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
/* | |
TODO: | |
- add support for https | |
- add POST support | |
*/ | |
var http = require('http'); |
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
// Regels die met // starten zijn commentaar en horen niet bij de code van het programma. | |
// Dit soort regels zijn handig om dingen in uit te leggen zodat als je later | |
// de code nog eens door leest je nog weet wat er ook alweer precies gebeurd. | |
// Deze regels zijn in een browser nodig om 2d tekeningen te kunnen maken. | |
// ctx is het object wat wij straks kunnen gebruiken om alles mee te tekenen. | |
var canvas = document.getElementById('canvas'); | |
var ctx = canvas.getContext('2d'); |
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
char* size(char* buffer, unsigned int length, unsigned int num) { | |
// floor(log(pow(2, 64)) / log(1024)) = 6 | |
const char* unit[] = { | |
"B", "KB", "MB", "GB", "TB", "PB", "EB" | |
}; | |
if (num == 0) { | |
snprintf(buffer, length, "0 %s", unit[0]); | |
} else { | |
unsigned int base = floor(log(num) / log(1024)); |
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
#include <sys/time.h> // gettimeofday() | |
unsigned long int millitime() { | |
struct timeval t; | |
gettimeofday(&t, NULL); | |
return (t.tv_sec * 1000) + (t.tv_usec / 1000); | |
} |
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
/* ~$ g++ test.c -o test | |
* ~$ ./test | |
* 12 | |
*/ | |
#include <stdio.h> | |
class Test { | |
public: |
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
package main | |
import ( | |
"fmt" | |
"time" | |
"net/http" | |
) | |
var requests = 0 |
OlderNewer