Skip to content

Instantly share code, notes, and snippets.


Harmen Stoppels haampie

View GitHub Profile
View gist:995631
function LoadDashBoard()
var loadUrl = "ajax/load_agents.php";
var ajax_load_bar = "<div align='center'><img src='images/loadingAnimation.gif' alt='loading...' /></div>";
$("#actdiv").html(ajax_load_bar).load(loadUrl,function() {
haampie / rug-to-csv.js
Created Sep 10, 2011
RUG kalender naar Google Calendar dmv CSV
View rug-to-csv.js
NodeList.prototype.forEach = Array.prototype.forEach;
HTMLCollection.prototype.forEach = Array.prototype.forEach;
Date.prototype.getSimpleDateString = function(){
return this.getDate() + '-' + (this.getMonth()+1) + '-' + this.getFullYear();
function Vakkenlijst(){
this.lijst = [];
haampie / exc18.cpp
Created Sep 20, 2015
rereading stdin
View exc18.cpp
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char * argv[])
string line;
bool foundStart = false;
size_t start = 0;
View example.js
ga(function(tracker) {
var linkerParam = tracker.get('linkerParam');
// hier nu iets doen met linkerParam, want hier issie beschikbaar.
// kan zijn dat de DOM nog *niet* geladen is als je code in de header staat
document.addEventListener("DOMContentLoaded", function(event) {
var form = document.getElementById('some-form');
form.action= /*...*/;
View gist:778e907956d253478cf7
proxy_cache_path /var/www/gravatar-cache levels=1:2 keys_zone=gravatar:8m inactive=24h use_temp_path=off max_size=1000m;
proxy_cache_key "$scheme$request_method$host$request_uri";
server {
listen 443 ssl http2;
server_name [hidden];
access_log off;
ssl_certificate [hidden];
haampie /
Last active Jan 6, 2016
locks 'n stuff
#include <condition_variable>
#include <iomanip>
#include <iostream>
#include <thread>
using namespace std;
int someNumber = 0;
mutex numberMutex;
condition_variable cv;
View index.html
<form id="form" action="/" method="post">
<div class="inputarea">
<h1>Leave your email to obtain 5 free articles</h1>
<label for="email">Email</label>
<input type="email" name="email" id="email" placeholder="" required autocomplete="email" class="input" />
<p><input type="submit" id="submit" class="button" value="Send!"></p>
View inject.js
var autocompletes = ['name', 'honorific-prefix', 'given-name',
'additional-name', 'family-name', 'honorific-suffix',
'nickname', 'username', 'new-password',
'current-password', 'organization-title', 'organization',
'street-address', 'address-line1', 'address-line2',
'address-line3', 'address-level4', 'address-level3',
'address-level2', 'address-level1', 'country',
'country-name', 'postal-code', 'cc-name', 'cc-given-name',
'cc-additional-name', 'cc-family-name', 'cc-exp',
'cc-exp-month', 'cc-exp-year', 'cc-csc', 'cc-type',
haampie / hydrate.php
Created Jul 25, 2016
Hydration methods
View hydrate.php
$iterations = 1000000;
class Example
private $a;
private $b;
private $c;
private $d;
haampie / request.php
Last active Aug 18, 2016
Sync / Async event handlers
View request.php
// In requests:
final class SomeSubscriber {
public function applyDomainEvent(DomainEvent $xyz) {
// Maybe fire another event to get some consistency.