Skip to content

Instantly share code, notes, and snippets.

View danpoltawski's full-sized avatar

Dan Poltawski danpoltawski

View GitHub Profile
@danpoltawski
danpoltawski / gist:9029458
Created February 16, 2014 04:55
time to switch to mongodb?
danp@bart:~$ time psql shouldirun -c "SELECT COUNT(DISTINCT(identifierforvendor)) FROM request_info"
count
-------
45543
(1 row)
real 0m6.880s
user 0m0.003s
sys 0m0.003s

Keybase proof

I hereby claim:

  • I am danpoltawski on github.
  • I am dan_p (https://keybase.io/dan_p) on keybase.
  • I have a public key whose fingerprint is 8EA5 B6D5 8A39 7D9E 23F6 84A9 7A7C 601E 12B7 0155

To claim this, I am signing this object:

@danpoltawski
danpoltawski / gist:e12912c7516e5913dadc
Created September 29, 2014 08:54
mdk installation failure
Downloading/unpacking moodle-sdk
Getting page http://pypi.python.org/simple/moodle-sdk
URLs to search for versions for moodle-sdk:
* http://pypi.python.org/simple/moodle-sdk/
Getting page http://pypi.python.org/simple/moodle-sdk/
Analyzing links from page https://pypi.python.org/simple/moodle-sdk/
Found link https://pypi.python.org/packages/source/m/moodle-sdk/moodle-sdk-1.3.tar.gz#md5=aedf79f6404063e493ef2ee18fe103ad (from https://pypi.python.org/simple/moodle-sdk/), version: 1.3
Downloading from URL https://pypi.python.org/packages/source/m/moodle-sdk/moodle-sdk-1.3.tar.gz#md5=aedf79f6404063e493ef2ee18fe103ad (from https://pypi.python.org/simple/moodle-sdk/)
Running setup.py egg_info for package moodle-sdk
...................................................................... 70
...................................................................... 140
...................................................................... 210
...................................................................... 280
...................................................................... 350
...................................................................... 420
...................................................................... 490
...................................................................... 560
...................................................................... 630
...................................................................... 700
@danpoltawski
danpoltawski / gist:03c84105bcde700c0f08
Created November 4, 2014 17:21
behat Moodle 2.8rc1 firefox OSX
Moodle 2.8rc1 (Build: 20141104), pgsql, 6ce4b8ea30ec3c5d843d0d8358c402f8302a2a65
Server OS "Darwin", Browser: "firefox"
Started at 04-11-2014, 11:11
...................................................................... 70
...................................................................... 140
...................................................................... 210
...................................................................... 280
...................................................................... 350
...................................................................... 420
...................................................................... 490
@danpoltawski
danpoltawski / hack-formslib
Created November 7, 2014 14:21
hack formslib xpath alternative
diff --git a/composer.json b/composer.json
index b6f5246..e74cb76 100644
--- a/composer.json
+++ b/composer.json
@@ -6,7 +6,7 @@
}
],
"require-dev": {
- "phpunit/phpunit": "3.7.*",
+ "phpunit/phpunit": "4.3.*",
danp@lisa:~$ cat test.sh
#!/bin/bash
set -e
grep 'foo' /file/which/doesnt/exist || echo 'grep failed'
if some-non-existant-command
then
echo 'Its a bug'
find . -name *.css ! -path '*/vendor/*' ! -path '*/lib/yuilib/*' ! -path '*/lib/*' ! -path '*/bootstrapbase/style/*' -exec csslint --errors=display-property-grouping,duplicate-properties,empty-rules,errors,known-properties --format=compact {} \; | grep -v 'Lint Free!'
/Users/danp/moodles/im/moodle/blocks/community/styles.css: line 10, col 1, Error - Rule is empty.
/Users/danp/moodles/im/moodle/blocks/community/styles.css: line 15, col 1, Error - Rule is empty.
/Users/danp/moodles/im/moodle/blocks/community/styles.css: line 17, col 1, Error - Rule is empty.
/Users/danp/moodles/im/moodle/blocks/community/styles.css: line 28, col 1, Error - Rule is empty.
/Users/danp/moodles/im/moodle/blocks/community/styles.css: line 70, col 5, Error - Duplicate property 'color' found.
/Users/danp/moodles/im/moodle/blocks/community/styles.css: line 157, col 1, Error - Rule is empty.
/Users/danp/moodles/im/moodle/blocks/navigation/styles.css: line 46, col 91, Error - Duplicate property 'padding-left' found.
danp@lisa:~/www/im (master)$ git reset --hard origin/master
HEAD is now at 7ab171f Merge branch 'wip-MDL-49742-master' of git://github.com/abgreeve/moodle
(reverse-i-search)`grunt': grunt
danp@lisa:~/www/im (master)$ rm theme/bootstrapbase/amd/build/bootstrap.min.js
danp@lisa:~/www/im (master *)$ grunt
Running "startup" task
Running "shifter" task
shifter [info] racing to find the closest .shifter.json file
shifter [info] woohoo, found a config here: /Users/danp/moodles/im/moodle/.shifter.json
@danpoltawski
danpoltawski / gist:0bba60109e3938d1585a
Created July 21, 2015 08:57
Should iRun Lines of code
cloc .
273 text files.
260 unique files.
97 files ignored.
http://cloc.sourceforge.net v 1.64 T=0.95 s (188.9 files/s, 21649.3 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Objective C 71 3588 1071 10314