Skip to content

Instantly share code, notes, and snippets.

View haampie's full-sized avatar

Harmen Stoppels haampie

View GitHub Profile
function LoadDashBoard()
{
$("#actdiv").hide('fast');
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() {
$(".agent-tab").click(function(){
alert('cliek');
});
});
@haampie
haampie / rug-to-csv.js
Created September 10, 2011 20:47
RUG kalender naar Google Calendar dmv CSV
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
haampie / exc18.cpp
Created September 20, 2015 10:28
rereading stdin
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char * argv[])
{
string line;
bool foundStart = false;
size_t start = 0;
ga(function(tracker) {
var linkerParam = tracker.get('linkerParam');
console.log(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= /*...*/;
});
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
haampie / main.cc
Last active January 6, 2016 23:11
locks 'n stuff
#include <condition_variable>
#include <iomanip>
#include <iostream>
#include <thread>
using namespace std;
int someNumber = 0;
mutex numberMutex;
condition_variable cv;
@haampie
haampie / index.html
Last active April 19, 2016 20:21
Examples
<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="name@example.com" required autocomplete="email" class="input" />
<p><input type="submit" id="submit" class="button" value="Send!"></p>
</div>
</form>
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
haampie / hydrate.php
Created July 25, 2016 21:28
Hydration methods
<?php
$iterations = 1000000;
class Example
{
private $a;
private $b;
private $c;
private $d;
@haampie
haampie / request.php
Last active August 18, 2016 23:21
Sync / Async event handlers
<?php
// In requests:
final class SomeSubscriber {
public function applyDomainEvent(DomainEvent $xyz) {
// Maybe fire another event to get some consistency.
}
}