Skip to content

Instantly share code, notes, and snippets.

View dobesv's full-sized avatar

Dobes Vandermeer dobesv

View GitHub Profile
@dobesv
dobesv / Buf.asByteBuffer.patch
Created March 15, 2012 08:59
Buf asByteBuffer patch
diff -r cb58d11083c7 src/sys/java/fan/sys/Buf.java
--- a/src/sys/java/fan/sys/Buf.java Thu Mar 15 14:50:08 2012 +0800
+++ b/src/sys/java/fan/sys/Buf.java Thu Mar 15 16:59:06 2012 +0800
@@ -11,6 +11,8 @@
import java.math.*;
import java.nio.*;
+import fanx.interop.Interop;
+
/**
@dobesv
dobesv / cityburner.elm
Created January 30, 2013 18:59
This source file causes the elm compiler to fail with "out of memory".
import Automaton (init')
import JavaScript
import JavaScript.Experimental
foreign import jsevent "provideRobotAnimation"
(castElementToJSElement (spacer 0 0))
jsRobotAnimation :: Signal JSElement
robotAnimation = lift (castJSElementToElement 262 373) jsRobotAnimation
@dobesv
dobesv / cityburner.elm
Created January 30, 2013 19:09
Moving the buildings to their own variables allows compilation to complete but it still takes 65 seconds.
import Automaton (init')
import JavaScript
import JavaScript.Experimental
foreign import jsevent "provideRobotAnimation"
(castElementToJSElement (spacer 0 0))
jsRobotAnimation :: Signal JSElement
robotAnimation = lift (castJSElementToElement 262 373) jsRobotAnimation
@dobesv
dobesv / .htaccess
Last active January 4, 2016 10:18 — forked from thoop/.htaccess
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change http://example.com (at the end of the last RewriteRule) to your website url
<IfModule mod_headers.c>
#RequestHeader set X-Prerender-Token "YOUR_TOKEN"
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
@dobesv
dobesv / Bouncy.elm
Last active August 29, 2015 14:19
Bouncing ball comparisons
import Color exposing (..)
import Graphics.Collage exposing (..)
import Graphics.Element exposing (..)
import Signal exposing (..)
import Time
import Mouse
gravity = 40.0
initialState = {
@dobesv
dobesv / index.md
Last active August 29, 2015 14:21
Use LeadPages + Stripe + WordPress + Gravity Forms together

This allows you to set a LeadPages button to pop up a Stripe payment form, and then send the data to your WordPress Gravity Forms (with Stripe Add-On) to capture the payment and record the form submission. This means you can also add other feeds to the same form to add people to a mailing list and so on.

Usage:

  1. You will require WordPress with Gravity Forms and the Gravity Forms Stripe Add-On
  2. Create a form with a credit card field, an email field, a "total" field, and a product "drop down" field.
  3. Mark the product "drop down" field as "Allow field to be populated dynamically" in the Advanced tab
  4. For the product "drop down" it doesn't matter what products you have for this purpose, the values will be filled from this script
  5. Copy the appropriate form and field IDs into the values below
  6. Also fill in the rest of it as you please with links to an image, your product name, price and so on
@dobesv
dobesv / ReadMe.md
Last active July 31, 2018 16:37
Login script for custom auth0 database to auth via WordPress XML-RPC

You must provide the following configuration variables:

  1. WP_XMLRPC_URL = https://www.yourdomain.com/xmlrpc.php (replace with your domain and use http:// if you don't have SSL support)
  2. WP_ADMIN_USER = admin (use your own admin username)
  3. WP_ADMIN_PASSWORD = somepassword (use your own admin password)
// Create a new bookmark, write javascript: and paste in the next line:
// When you are on the WebEx page to fill out name and email, click the bookmarklet
(function (name, email) { var f=window.parent.frames[1], e=(function(id) { return f.document.getElementById(id) }), an = e('attendeeName'), ae = e('attendeeEmail'), but=e('mwx-btn-pmr-enter-lobby'); an.value=name; f.AttEmailOnblur(); ae.value='[email protected]'; but.disabled=false; })("Dobes Vandermeer", '[email protected]')
@dobesv
dobesv / JacksonMapper.java
Created October 29, 2015 00:59
Use jackson to map jdbi beans
package caltrac.db;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import org.skife.jdbi.v2.StatementContext;
import org.skife.jdbi.v2.tweak.ResultSetMapper;