Skip to content

Instantly share code, notes, and snippets.

View commadelimited's full-sized avatar

Andy Matthews commadelimited

View GitHub Profile
@commadelimited
commadelimited / Gruntfile.js
Created September 8, 2014 17:00
Gruntfile for Node-webkit project
/*jshint camelcase: false*/
module.exports = function (grunt) {
'use strict';
// load all grunt tasks
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-jshint');
scores = [
('Andy', 85),
('Bob', 92),
('Cindy', 85),
('Dale', 89),
('Edmund', 81),
]
def place(scores):

I'm having trouble storing a date into a Peewee DateField for SQLite. I keep getting "Invalid Date" What am I doing wrong? I've tried all three of the options below and all have the same result.

@commadelimited
commadelimited / gist:ec44848faa2ac767e1b1
Created November 19, 2014 22:17
Group, and count, results in a numbered text file.
Given a text file with n numbers of rows, each containing a single integer, sorted in descending order, I want to group (by 10s) and count the results. So for the following content:
100
100
99
87
75
75
72
69
@commadelimited
commadelimited / 2011-12-14-04.js
Created January 19, 2012 17:18
Refreshing jQuery Mobile widgets
<label for="sCountry">Country:</label>
<select name="sCountry" id="sCountry">
<option value="">Where You Live:</option>
<option value="ad">Andorra</option>
<option value="ae">United Arab Emirates</option>
</select>
var myselect = $("#sCountry");
myselect[0].selectedIndex = 3;
myselect.selectmenu('refresh');
@commadelimited
commadelimited / 2011-12-14-09.js
Created January 19, 2012 17:22
Refreshing jQuery Mobile widgets
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<legend>Agree to the terms:</legend>
<input type="checkbox" name="checkbox-1" id="checkbox-1" class="custom" />
<label for="checkbox-1">I agree</label>
</fieldset>
</div>
$('#checkbox-1').attr('checked',true).checkboxradio('refresh');
@commadelimited
commadelimited / 2011-12-14-01.js
Created January 19, 2012 17:15
Refreshing jQuery Mobile widgets
$('body').prepend('<textarea id="myTextArea"></textarea>');
$('#myTextArea').textinput();
@commadelimited
commadelimited / 2011-12-14-03.js
Created January 19, 2012 17:17
Refreshing jQuery Mobile widgets
$('body').append('<a href="" data-theme="e" id="myNewButton">testing</a>');
$('#myNewButton').button();
@commadelimited
commadelimited / 2011-12-14-06.js
Created January 19, 2012 17:19
Refreshing jQuery Mobile widgets
<div data-role="fieldcontain">
<label for="slider-2">Input slider:</label>
<input type="range" id="slider-2" value="25" min="0" max="100" />
</div>
$('#slider-2').val(80).slider('refresh');
@commadelimited
commadelimited / 2011-12-14-08.js
Created January 19, 2012 17:22
Refreshing jQuery Mobile widgets
<div data-role="fieldcontain">
<fieldset data-role="controlgroup" data-type="horizontal">
<legend>Layout view:</legend>
<input type="radio" name="radio-view" value="list" />
<label for="radio-view-a">List</label>
<input type="radio" name="radio-view" value="grid" />
<label for="radio-view-b">Grid</label>
<input type="radio" name="radio-view" value="gallery" />
<label for="radio-view-c">Gallery</label>
</fieldset>