Skip to content

Instantly share code, notes, and snippets.

View thomasdegry's full-sized avatar
🍾
Popping off

Thomas Degry thomasdegry

🍾
Popping off
View GitHub Profile
<?php
if(!empty($_POST) || !empty($_FILES)) {
# toegestane extensies voor foto
$allowed_extensions = array('jpeg', 'jpg', 'png');
# name converten naar array adhv explode functie, hier op een punt
$temp_name = explode(".", $_FILES['file']['name']);
$extension = end($temp_name);
# eerst checken op mime type, dan op file size en ten slotte op extension als alles passed in de if
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Swipe</title>
<style>
html, body {
width: 100%;
height: 100%;
(function(a){if(typeof define==="function"&&define.amd&&define.amd.jQuery){define(["jquery"],a)}else{a(jQuery)}}(function(f){var p="left",o="right",e="up",x="down",c="in",z="out",m="none",s="auto",l="swipe",t="pinch",A="tap",j="doubletap",b="longtap",y="hold",D="horizontal",u="vertical",i="all",r=10,g="start",k="move",h="end",q="cancel",a="ontouchstart" in window,v=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled,d=window.navigator.pointerEnabled||window.navigator.msPointerEnabled,B="TouchSwipe";var n={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:true,triggerOnTouchLeave:false,allowPageScroll:"auto",fallbackToMouseEvents:true,excludedElements:"label, button, input, select, textar
<?php
$message_klant = '<html><body>';
$message_klant .= '<h2>Beste ' . $voornaam . '</h2>';
$message_klant .= '<p>Fijn dat u zonet op ' . date('d-m H:i') . ', ' . $aantal . 'x "' . $product_naam . '" bestelde op mijn website.</p>';
$message_klant .= '<p>Van zodra u uw bestelling betaalt verstuur ik deze met de post!</p>';
if($product_naam == 'Ticket Herbert in concert') {
$message_klant .= '<p>HERBERT IN CONCERT';
} else {
$message_klant .= '<p> Herbert Verhaeghe';
/*!
* jQuery JavaScript Library v1.10.2
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
@thomasdegry
thomasdegry / uiview
Created August 31, 2014 22:15
UIView swift
import UIKit
class HomeView: UIView {
override init(frame: CGRect) {
super.init(frame: frame);
self.backgroundColor = UIColor.redColor()
println("custom view init");
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell = tableView.dequeueReusableCellWithIdentifier("CELL") as? UITableViewCell
if (cell == nil) {
cell = UITableViewCell(style: UITableViewCellStyle.Value1, reuseIdentifier: "CELL")
}
let cellSupermarket = superMarkets[indexPath.row]
cell?.textLabel.text = cellSupermarket.name
@thomasdegry
thomasdegry / gist:889fc96a592602c94a57
Created November 20, 2014 16:37
Mapbox cluster geojson
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Markercluster with Mapbox marker data</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox.js/v2.1.4/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v2.1.4/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"fucked up collectionview is messing with me, width %f, two wide cells are %f, inner cells should be %f", self.collectionView.bounds.size.width, self.collectionView.bounds.size.width * 0.173333333, self.collectionView.bounds.size.width * 0.130666667);
if(indexPath.row % 7 == 0) {
NSLog(@"left");
return CGSizeMake(self.collectionView.bounds.size.width*0.173333333, 54);
} else if(indexPath.row % 7 == 6) {
NSLog(@"right");
return CGSizeMake(self.collectionView.bounds.size.width*0.173333333, 54);
} else {
NSLog(@"mid");