Skip to content

Instantly share code, notes, and snippets.

A priest and a shepherd from Australia participate in a TV game. After answering all the questions, there is a tie.
So both are given one final assignment. It is to write a poem in three minutes, using the word "Timbuktu".
It is a city in Africa.
The priest returns with the fruit of his inspiration:
"I was a father all my life,
I had no children, had no wife,
I read the bible through and through
on my way to Timbuktu ... "
@marsch
marsch / metro.config.js
Created May 5, 2021 17:09
metro with symlink support
const fs = require('fs')
/**
* Metro configuration for React Native
* https://github.com/facebook/react-native
*
* @format
*/
const isSymlink = dependency =>
<?php
/**
* Show WP author dropdown list
*
* @return array
*/
static function user_list() {
global $cv_admin_users_list;
if ( !empty( $cv_admin_users_list ) ) {
import di from './di'
import { ext } from 'xtpoint'
window.ext = ext
const modulesContext = require.context('../plugins', true, /^\.\/[^\/]+?\/bundle\.js$/)
if (module.hot) {
console.log('accept hot?!??!?!?')
module.hot.accept(modulesContext.id, () => {
import { h, Component } from 'preact'
import { PropTypes } from 'preact-compat'
import { withRouter } from 'react-router'
import { connect } from 'react-redux'
// OPTIONAL: patch Component by default (you might want to delete this if you're a purist)
Component.prototype.linkRef = function(name) {
return linkRef(this, name)
}
export function linkRef(component, name) {
import React from 'react';
import { Router, Route, browserHistory, IndexRoute, Redirect, applyRouterMiddleware } from 'react-router'
import useScroll from 'react-router-scroll';
import BaseComponent from '../base-component';
import ViewContainer from './view-container';
import ViewManager from './view-manager';
class SiteManager extends BaseComponent {
constructor(...args) {
super(...args);
@marsch
marsch / index.js
Created July 28, 2016 20:36
super dirty dynamic routing + static routes + oauth + fetch
import React from 'react'
import {render} from 'react-dom'
import { Link, Router, RouterContext, browserHistory } from 'react-router'
import superagent from 'superagent'
import superagentOauth from '@zalando/superagent-oauth2-client'
import deepFreeze from 'deep-freeze-strict'
import config from './config'
let OAuth = require('@zalando/oauth2-client-js')
{"links":[{"href":"http://33.33.33.141/folders/api/projects/1363704160f9b16bd1-35f6-4955-85dc-dbc1486c3288","rel":"project"}]}
@marsch
marsch / gist:4232288
Created December 7, 2012 10:10
options.check method
options.check = (composition) ->
if composition.type is type
if _(composition.params).isEqual options.params
return true
else if composition.params?.forceInit
# so the view will be re-initialized everytime
return false
else
# trigger an event in the view that params have changed
# so views can handle the change on there own
@marsch
marsch / microdata-version.html
Created August 25, 2012 23:06
rdfa lite vs. microdata
<div itemscope itemtype="http://schema.org/Product">
<img itemprop="image" src="dell-30in-lcd.jpg" />
<span itemprop="name">Dell UltraSharp 30" LCD Monitor</span>
<div itemprop="aggregateRating"
itemscope itemtype="http://schema.org/AggregateRating">
<span itemprop="ratingValue">87</span>
out of <span itemprop="bestRating">100</span>
based on <span itemprop="ratingCount">24</span> user ratings
</div>