Skip to content

Instantly share code, notes, and snippets.

View tersor's full-sized avatar

Terje Sørbø tersor

View GitHub Profile
@tersor
tersor / auth.go
Created May 20, 2021 08:52
Golang basic auth example
package main
import (
"encoding/base64"
"net/http"
"strings"
)
type handler func(w http.ResponseWriter, r *http.Request)
1001190022-H0113-08M2-88326:
[05/Feb/2021:15:14:55 +0100] stage.fbapi.visitinvite.com "GET /bookings/ref/1001190022-H0113-08M2-88326 HTTP/1.1" 404 65 "" "RestSharp/106.0.0.0" "HTTP/1.1" []
[05/Feb/2021:15:14:55 +0100] stage.fbapi.visitinvite.com "POST /bookings HTTP/1.1" 201 400 "" "RestSharp/106.0.0.0" "HTTP/1.1" [{"reference":"1001190022-H0113-08M2-88326","unitRef":"1001190022-H0113","startTime":"2021-02-05T13:00:00Z","endTime":"2021-03-01T14:45:00Z","guests":[{"email":"Annette.Usken@forsvarsbygg.no","phone":"90778300","reference":"1001190022-H0113-08M2-88326"}]}]
1001190022-H0113-08-88326:
[05/Feb/2021:09:34:50 +0100] stage.fbapi.visitinvite.com "GET /bookings/ref/1001190022-H0113-08-88326 HTTP/1.1" 404 65 "" "RestSharp/106.0.0.0" "HTTP/1.1" []
[05/Feb/2021:09:35:48 +0100] stage.fbapi.visitinvite.com "GET /bookings/ref/1001190022-H0113-08-88326 HTTP/1.1" 404 65 "" "RestSharp/106.0.0.0" "HTTP/1.1" []
[05/Feb/2021:09:35:49 +0100] stage.fbapi.visitinvite.com "POST /bookings HTTP/1.1" 201 396 "" "RestSharp/10
<?php
/**
* Wordpress Bootstrap navbar walker
*
* For WordPress version 3.0.0+ and Bootstrap 3+
*
* Set Title Attribute to "divider" for submenu divider.
* Set Title Attribute to "header" for submenu header.
*
* Code example:
@tersor
tersor / gist:4694683
Created February 1, 2013 22:43
Include custom post type in WordPress search
add_filter( 'pre_get_posts', 'cpt_search' );
function cpt_search( $query ) {
if ( $query->is_search )
$query->set( 'post_type', array( 'post', 'page', 'movies', 'products', 'portfolio' ) );
return $query;
};
@tersor
tersor / ubuntu_ruby_install.sh
Created August 20, 2012 05:51
Ubuntu Ruby install - rbenv and ruby-build
#!/bin/bash
# Install rbenv
# https://github.com/sstephenson/rbenv
cd ~
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> .bash_profile
echo 'eval "$(rbenv init -)"' >> .bash_profile