Skip to content

Instantly share code, notes, and snippets.

View dannykopping's full-sized avatar

Danny Kopping dannykopping

View GitHub Profile
@dannykopping
dannykopping / error
Created August 20, 2011 12:13
Git Clone error
$ git clone git@github.com:dannykopping/Dwarf.git --progress
Cloning into Dwarf...
error: git upload-pack: git-pack-objects died with error.
fatal: git upload-pack: aborting due to possible repository corruption on the re
mote side.remote: error: Could not read fa2328373fb5a73ec44fd5f7f862e1fe3aea6c0e
remote: fatal: bad tree object fa2328373fb5a73ec44fd5f7f862e1fe3aea6c0e
remote: aborting due to possible repository corruption on the remote side.
fatal: early EOF
fatal: index-pack failed
mysql> SELECT jaro_winkler_similarity("Danny", "Daniel") AS similarity;
+-------------------+
| similarity |
+-------------------+
| 0.789999961853027 |
+-------------------+
1 row in set (0.00 sec)
mysql> SELECT *, jaro_winkler_similarity(`name`, "mr whiskers") AS score
-> FROM CatName
-> ORDER BY score DESC
-> LIMIT 10;
+-------+----------------+----------+
| id | name | score |
+-------+----------------+----------+
| 10105 | Mr. Whiskers | 0.977778 |
| 10108 | Mr. Wiskers | 0.951515 |
| 16204 | Whiskers | 0.909091 |
mysql> SELECT *, jaro_winkler_similarity(`name`, "mr whiskers") AS score
-> FROM (SELECT id, `name` FROM CatName WHERE `name` LIKE "%mr%" OR `name` LIKE "%whiskers%") AS likeMatches
-> ORDER BY score DESC
-> LIMIT 10;
+-------+----------------+------------------+
| id | name | score |
+-------+----------------+------------------+
| 10105 | Mr. Whiskers | 97.7777779102325 |
| 10108 | Mr. Wiskers | 95.1515138149261 |
| 16204 | Whiskers | 90.9090936183929 |
@dannykopping
dannykopping / NonScrollingTextArea.as
Created October 13, 2011 17:30
Non-scrolling Spark TextArea
package com.dannykopping.controls
{
import flash.events.MouseEvent;
import spark.components.TextArea;
public class NonScrollingTextArea extends TextArea
{
public function NonScrollingTextArea()
{
@dannykopping
dannykopping / git-submodules.weird
Created January 23, 2012 09:01
Weird submodules issue
bash-3.2# git submodule status
f97bbf008aaa0741ca6996cc167ad61e1f5b0179 neo4jphp (0.0.6-beta-9-gf97bbf0)
dd42c4d26cb35fd128793494b9a6e952994e5fd0 slim (1.5.1.2-117-gdd42c4d)
d77b9e85c1b4ca868a267a0805703ef33ca5753b slim-plugins (1.0.0-17-gd77b9e8)
@dannykopping
dannykopping / behat-awesomeness.txt
Created March 29, 2012 20:26
Behat Awesomeness
Feature: Testing the REST functionality of Aerial Framework
with Slim Framework and Guzzle
Scenario: Fetching a simple JSON response # features/rest.feature:4
Given that I pass no parameters # FeatureContext::thatIPassNoParameters()
When I call "/internal/test/simple" # FeatureContext::iCall()
Then the response is JSON # FeatureContext::theResponseIsJson()
Then the response status code should be 200 # FeatureContext::theResponseStatusCodeShouldBe()
1 scenario (1 passed)
@dannykopping
dannykopping / install-phing.sh
Created April 8, 2012 10:22
PEAR install Phing
sudo pear channel-discover pear.phing.info
sudo pear install -f -a phing/phing
@dannykopping
dannykopping / install-phpunit.sh
Created April 8, 2012 10:19
PEAR install PHPUnit
sudo pear channel-discover pear.phpunit.de
sudo pear install -f -a pear.phpunit.de/PHPUnit
@dannykopping
dannykopping / install-behat.sh
Created April 8, 2012 10:20
PEAR install Behat
sudo pear channel-discover pear.behat.org
sudo pear install -f -a behat/behat behat/gherkin