Skip to content

Instantly share code, notes, and snippets.

Björn Ali Göransson bjorn-ali-goransson

Block or report user

Report or block bjorn-ali-goransson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
bjorn-ali-goransson / test.php
Created Mar 7, 2018
List orphaned and missing media (attachments)
View test.php
require 'wp-blog-header.php';
bjorn-ali-goransson / adminer.php
Last active Mar 6, 2018
Automatic login to Adminer using Wordpress DB credentials (wp-config.php)
View adminer.php
function define_find( $filename = 'wp-config.php' ) { //
if ( $filename == 'wp-config.php' ) {
$filename = dirname( __FILE__ ) . '/' . basename( $filename );
// look up one directory if config file doesn't exist in current directory
if ( ! file_exists( $filename ) )
$filename = dirname( __FILE__ ) . '/../' . basename( $filename );
bjorn-ali-goransson / Example.csproj
Created Jul 4, 2017
Sample csproj for classic .NET apps
View Example.csproj
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
bjorn-ali-goransson / LoginTest.aspx
Created Jun 16, 2017
This file can help by debugging "user cannot log in" problems when in EPiServer the user is just redirected back to the login page when logging in. Probably you are authenticated but not authorized.
View LoginTest.aspx
<%@ Page Language="C#" %>
<script runat="server">
protected override void OnInit(EventArgs e){
foreach(var role in System.Web.Security.Roles.GetRolesForUser()){
bjorn-ali-goransson / HttpUtility.cs
Created Jul 3, 2016
Standalone HttpUtility for using ParseQueryString without dependency on System.Web
View HttpUtility.cs
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
bjorn-ali-goransson / AwsAuthenticator.cs
Created May 4, 2016
Authenticate to AWS with RestSharp (nicked from minio-dotnet / V4Authenticator with minor modifications)
View AwsAuthenticator.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
namespace Rest.Authentication
public class AwsAuthenticator : RestSharp.Authenticators.IAuthenticator
public string AccessKeyId { get; }
View jquery.hasattr.js
$.fn.hasAttr = function(attrName){
var element = this[0];
return element.hasAttribute(attrName);
bjorn-ali-goransson / arabic-alphabet.htm
Created Nov 5, 2015
Generation of all arabic alphabet + harakah combinations in one A4
View arabic-alphabet.htm
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src=""></script>
<link href='' rel='stylesheet' type='text/css'>
th {
font-family: Arial;
bjorn-ali-goransson / caret.less
Created Oct 24, 2015
CSS-only caret inheriting from text-color
View caret.less
.caret(@width: @caret-width-base) {
display: inline-block;
content: '';
width: 0;
height: 0;
margin-left: 10px;
vertical-align: middle;
border-top: @width dashed;
border-top: @width solid ~"\9"; // IE8
border-right: @width solid transparent;
bjorn-ali-goransson / Remove.aspx
Created Sep 15, 2015
Remove EPiServer content programmatically
View Remove.aspx
<%@ Page Language="C#" %>
<!DOCTYPE html>
<html xmlns="">
<head runat="server">
<form id="form1" runat="server">
You can’t perform that action at this time.