Skip to content

Instantly share code, notes, and snippets.

<?php
include "config.php";
session_start();
if ( !$DB_NAME )
{
die("No database connection or database does not exist");
}
try {
$dbh = new PDO($DSN, $DB_USER, $DB_PASS);
<?php
$DB_NAME = "test";
$DB_USER = "root";
$DB_PASS = "root";
$DSN = "mysql:dbname=$DB_NAME;host=localhost";
?>

JavaScript Crypto Libraries

I start with a list and plan to create a comparison table.

Disclaimer: Javascript Cryptography Considered Harmful

Security recommendations

It should be noted that js crypto apps deployed via regular web hosting (a.k.a. host-based security) provide users with less security than installable apps with auditable static versions. Installable apps can be deployed as a Firefox or Chrome packaged app. These apps are basically signed zip files and their runtimes typically enforce a strict Content Security Policy (CSP) to protect users against XSS. This blogpost explains the trust model of the web quite well.

@d8ta
d8ta / SassMeister-input.scss
Last active August 29, 2015 14:11
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
/* mixin */
@mixin my-mixin($color: red) {
border: 1px solid $color;
width: 100px;
}
@d8ta
d8ta / SassMeister-input.scss
Created December 11, 2014 11:49
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
$color-red: #ff0000;
$has-color: false;
$color-content: 'color';
$colorList: #ff0000 #fff000 #ffff00;
$colorList2: #ff0000 #fff000 #ffff00;
var myApp = window.myApp || {};
myApp.lib = myApp.lib || {};
myApp.lib.log = function() {
};
myApp.myModule = (function (window, $) {
//superclass
function AbstractSlider(config) {
@d8ta
d8ta / hosting.js
Created November 29, 2014 09:00
hosting example
var test = 'hello'; //window, global var
(function() {
//function scope, but we can also access variables and functions in the global scope
//where this function was defined (thus test) and the variables of the parent function
console.log(test); //ToDo: wird in der console als undefined ausgegeben, warum?
//function declaration statement, function declarations get hoisted to top of function scope
function test2(param2, param3) {
console.log(test);
@d8ta
d8ta / prototypeExtension.js
Last active August 29, 2015 14:10
Prototyping extension
//immediate function: it is convention to sign it with an $ if you use jQuery (but we did not use jQuery here??))
$(function () {
//constructor function
function Person(name) {
console.log('constructor::Person');
console.log(this);
this.name = name;
}
@d8ta
d8ta / steuerung.js
Created June 14, 2014 14:24
Habe die touchsteuerung in die normale reingepackt; var (touchLeft usw.) holen sich die Button aus dem HTML und werden bei touch aktiv; Habe dann versucht in der KeyUp z.b Hammer wieder auf .off zu stellen. Läuft aber nicht
/**
* Spielsteuerung
* @returns {movePlayer}
*/
function movement() {
var up = down = left = right = touchLeft = touchRight = touchDown = touchUp = false;
var touchLeft = document.getElementById('left');
Hammer(touchLeft).on("touch", function() {
touchLeft = true;
#include <oogl/Texture2D.h>
#include <oogl/GLSLProgram.h>
oogl::GLSLProgram* phongshader;
oogl::Texture2D* skybox;
phongshader = oogl::GLSLProgram::create("/Users/danielraudschus/Documents/spacerace/projectSpacerace/spacerace/data/shader/textShader.vert", "/Users/danielraudschus/Documents/spacerace/projectSpacerace/spacerace/data/shader/textShader.frag");