Skip to content

Instantly share code, notes, and snippets.

View marijnvdwerf's full-sized avatar

Marijn van der Werf marijnvdwerf

View GitHub Profile
<?php
// start sessie
session_start();
include 'config.php';
$tekst1
$tekst2 = 'Je moet eerst registreren. Je wordt doorgestuurd.';
@marijnvdwerf
marijnvdwerf / gist:2399778
Created April 16, 2012 16:25
Kirby CMS Nginx config?
location / {
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php last;
break;
}
}
@marijnvdwerf
marijnvdwerf / team
Last active December 11, 2015 23:38
class Team {
public $scores = [0,1,3];
public static function compare($objectA, $objectB) {
$scoresA = $objectA->scores;
rsort($scoresA);
$scoresB = $objectB->scores;
rsort($scoresB);
@marijnvdwerf
marijnvdwerf / login.php
Created June 9, 2013 15:47
Simple login
<?php
if($_SERVER['REQUEST_METHOD'] !== 'POST') {
http_response_code(405); // Method Not Allowed
echo 'Data should be POST\'ed';
die();
}
if(!isset($_POST['username'])) {
http_response_code(400); // Bad Request
@marijnvdwerf
marijnvdwerf / ScreenshotActivity.java
Created October 11, 2013 10:39
ScreenshotActivity
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
View rootView = findViewById(R.id.root);
rootView.setDrawingCacheEnabled(true);
Bitmap b = rootView.getDrawingCache();
try {
b.compress(Bitmap.CompressFormat.PNG, 95, new FileOutputStream("/sdcard/screen.png"));
@marijnvdwerf
marijnvdwerf / gist:8068756
Created December 21, 2013 12:26
Android Dependency Manager

TODO

  • Needs to have a fancy, memorable name.
  • Dependencies should be specified in a YAML file. That way you don't need to write trailing commas to keep your history clean
  • Needs to see if you have an ant, maven or gradle style project.
  • Needs a file to define how a repository is structured. Because not everybody uses the same directory names for libraries and sample code.
  • Needs to have a seperate repository/website where repository structures are stored. So even plugins that aren't maintained anymore can be added.
  • Needs to have a way to track when a library is added. So you can search for a library, and see which one is preferred by others.

Thoughts?

<?php
class Response {
public $success = true;
public $action = null;
public $data = null;
public $error = null;
function __toString() {
return json_encode($this);
@marijnvdwerf
marijnvdwerf / style.css
Last active August 29, 2015 13:56
Readable Wikipedia
#mw-page-base {
height: 90px;
background: #f2f2f2;
}
#mw-head-base {
height: 59px;
margin: 0;

JouwWeb is a Dutch online website builder. Due to the ever growing share of mobile and tablet users, there was a need to support said devices. Nevertheless, the main focus was on releasing the latest version. Because most users have been using the service from a pc, focus was put on desktop usage.

This thesis describes the process of redesigning the mobile JouwWeb experience to better fit mobile devices. For this research, several methods of information retrieval have been used: desk research for discovering devices to focus on and as a basis for usability testing, interviews and surveys for finding out user goals and behavior, and usability research to test if prototyped features were user friendly.

Recommendations have been made on how to implement the redesigned features in the application. Based on the issues discovered while prototyping functionality, it has been suggested to pick a new direction for mobile users and focus on creating a hybrid app to evade browser behavior which deters the user experie

/**
* @param {ColorCutQuantizer} parent
* @param lowerIndex
* @param upperIndex
* @constructor
*/
ColorCutQuantizer.Vbox = function(parent, lowerIndex, upperIndex) {
this._parent = parent;
this._lowerIndex = lowerIndex;
this._upperIndex = upperIndex;