Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Kristoffer Rene Eckhoff Doff3n

🎯
Focusing
View GitHub Profile
@Doff3n
Doff3n / SwitchUI
Created Apr 27, 2015
ClassicUI/TouchUI toggle for AEM 6.0
View SwitchUI
javascript:(function() { if (window.location.href.indexOf("cf#") > -1) { window.location.href = window.location.href.replace("cf#", "editor.html");} else {window.location.href = window.location.href.replace("editor.html", "cf#");}})();
View Nested Paragraph Systems in CQ5
Set up your file structure for the innerParsys component:
innerParsys
-> parsys
-> new
- _cq_editConfig.xml
- .content.xml
- _cq_editConfig.xml
- .content.xml
- parsys.jsp
View gist:28cb15a3aa3cbc7ecb61
Verifying I am +doff3n on my passcard. https://onename.com/doff3n
@Doff3n
Doff3n / gist:6696207
Created Sep 25, 2013
Python String Calculator
View gist:6696207
import sys;
def add(numbers):
result=0; sep=","; nums=numbers
if(numbers.startswith("//")):
lines = numbers.splitlines()
pattern=lines[0][2:]
if(pattern[0]=="[" and pattern[pattern.length-1]=="]"):
pattern=pattern[1:pattern.length-1]
sep=pattern; nums=lines[1]
nums = nums.replace("\n",sep).split(sep)
@Doff3n
Doff3n / SwitchUI
Last active Jan 29, 2016
AEM 6.1 bookmarklets
View SwitchUI
javascript:(function() { if (window.location.href.indexOf("cf#") > -1) { window.location.href = window.location.href.replace("cf#", "editor.html");} else {window.location.href = window.location.href.replace("editor.html", "cf#");}})();
View Fibonacci on blockchain
pragma solidity ^0.4.2;
contract Fibonacci {
mapping (uint => uint) public numberstoredonblockchain;
function fibonacci(uint number) returns(uint result) {
if(numberstoredonblockchain[number] != 0) return numberstoredonblockchain[number];
if (number == 0) return 0;
View keybase.md

Keybase proof

I hereby claim:

  • I am doff3n on github.
  • I am doff3n (https://keybase.io/doff3n) on keybase.
  • I have a public key ASCtEL-LFMXu4HBILXZiSc-V9QK-ZToxJKuYMHLze7BxEwo

To claim this, I am signing this object:

@Doff3n
Doff3n / WCMMode
Created Apr 27, 2015
WCMMode bookmarklet toggle for AEM 6.0
View WCMMode
javascript:(function() { document.location = (document.location.href.search(/[?&]wcmmode=disabled/) < 0 ? document.location.href + (document.location.href.indexOf('?') < 0 ? '?' : (document.location.href.search(/\?./) < 0 ? '' : '&')) + 'wcmmode=disabled' : document.location.toString().replace(/wcmmode=disabled&?/, '')).replace(/[?&]$/, '');if(window.location.href.indexOf("cf#") > -1){location.reload();}})();
View react-map-gl-cluster.tsx
import * as React from 'react';
import { LngLatBounds, Map } from 'mapbox-gl';
import Supercluster from 'supercluster';
import * as GeoJSON from 'geojson';
import bbox from '@turf/bbox';
import { polygon, featureCollection } from '@turf/helpers';
import { withMap } from './Context';
import { MarkerProps } from 'react-map-gl';
export interface Props {