Skip to content

Instantly share code, notes, and snippets.

Daan Debie DandyDev

Block or report user

Report or block DandyDev

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
@DandyDev
DandyDev / MockHBaseConnection.java
Last active Sep 5, 2018 — forked from agaoglu/MockHTable.java
MockHBaseTable & MockHBaseConnection
View MockHBaseConnection.java
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.*;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutorService;
/**
@DandyDev
DandyDev / gen_slav.scala
Created Apr 1, 2016
Generate a sentence in a Slavic language
View gen_slav.scala
(0 to 300).map(_ => scala.util.Random.nextPrintableChar).filter(Set('k', 'v', 's', 'e', 'y', 't', 'p', 'a', 'u', 'o').contains).grouped(5).map(_.mkString("")).mkString(" ")
@DandyDev
DandyDev / example.cljs
Last active Feb 27, 2016
Generate keys for children in reagent component automatically
View example.cljs
(defmacro defcomponent [name attrs & body]
(let [i (.indexOf attrs '&)]
(if (> i -1)
(let [sym (get attrs (inc i))]
`(defn ~name ~attrs
~@(postwalk-replace {sym `(with-idx ~sym)} body)))
`(defn ~name ~attrs
~@body))))
View keybase.md

Keybase proof

I hereby claim:

  • I am dandydev on github.
  • I am dandy (https://keybase.io/dandy) on keybase.
  • I have a public key whose fingerprint is 648F BE1E 890B 4B63 5043 03E9 3C27 A86F E339 132D

To claim this, I am signing this object:

@DandyDev
DandyDev / 0_reuse_code.js
Created Jun 24, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@DandyDev
DandyDev / export-comments-for-disqus-xml.php
Last active Jul 30, 2019
Convert Comments in a MySQL database (in this case from the Diem CMS) to a Wordpress WXR file that can be imported by Disqus
View export-comments-for-disqus-xml.php
<?php
/*
Convert Comments in a MySQL database (in this case from the Diem CMS) to a Wordpress WXR file that can be imported by Disqus
usage: $ php export-comments-for-disqus-xml.php > comments.xml
*/
$connection = mysql_connect('localhost', 'username', 'password') or die(mysql_error());
$db = mysql_SELECT_db('databasename', $connection);
db_query("set character_set_client='utf8'");
db_query("set character_set_results='utf8'");
View IbanTest.java
import java.math.BigInteger;
public final class IbanTest {
public static final int IBANNUMBER_MIN_SIZE = 15;
public static final int IBANNUMBER_MAX_SIZE = 34;
public static final BigInteger IBANNUMBER_MAGIC_NUMBER = new BigInteger("97");
public static boolean ibanTest(String accountNumber) {
String newAccountNumber = accountNumber.trim();
You can’t perform that action at this time.