Skip to content

Instantly share code, notes, and snippets.

View Doff3n's full-sized avatar
🎯
Focusing

Kristoffer Rene Eckhoff Doff3n

🎯
Focusing
View GitHub Profile
@Doff3n
Doff3n / SwitchUI
Created April 27, 2015 14:34
ClassicUI/TouchUI toggle for AEM 6.0
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#");}})();
Set up your file structure for the innerParsys component:
innerParsys
-> parsys
-> new
- _cq_editConfig.xml
- .content.xml
- _cq_editConfig.xml
- .content.xml
- parsys.jsp
Verifying I am +doff3n on my passcard. https://onename.com/doff3n
@Doff3n
Doff3n / gist:6696207
Created September 25, 2013 07:24
Python String Calculator
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 January 29, 2016 13:00
AEM 6.1 bookmarklets
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#");}})();
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;

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 April 27, 2015 14:32
WCMMode bookmarklet toggle for AEM 6.0
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();}})();
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 {