This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gdata = new GitData("username", "password", "organization", "repository"); | |
/** | |
* Changing a file by committing directly to the master branch. | |
*/ | |
gdata.getBranch("master", function(error, master) { | |
master.getFile("path/to/file", function(error, file) { | |
// Update something within the file. | |
file.contents = file.contents.replace("foo", "bar"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The Nyan Cat License (NCL) Version 1.0 | |
Copyright (c) <year>, <copyright holders> | |
Redistribution and use in source and binary forms, with or without modification, are permitted provided that | |
the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the | |
following disclaimer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Comma-first | |
if (WHITELIST.indexOf(githubUser) > -1) { | |
return callback(null, { | |
state: 'success' | |
, description: githubUser + ' is whitelisted as a contributor.' | |
, target_url: 'https://github.com/' + githubUser | |
, whenComplete: function(foo, bar, cb) { | |
cb({ | |
foois: foo | |
, baris: bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Turns map into a javascript config object string for YUI. This is what allows configurations passed into the | |
* grailsUI tag to be passed along to the YUI widget. | |
*/ | |
def mapToConfig(attrs) { | |
attrs.collect { key, val -> | |
// if this is a handler, the val will be a javascript function, so don't quote it | |
if (key == 'handler') return "$key: $val" | |
"'$key': ${valueToConfig(val)}" | |
}.join(",\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YAHOO.util.Event.onDOMReady(function() { | |
var childTableRenderCallback = { | |
success: function(o) { | |
if (o.responseText !== undefined) { | |
// kill off any existing data tables to manage memory | |
if (GRAILSUI.childTable != undefined) { | |
GRAILSUI.childTable.destroy(); | |
} | |
var resultsDiv = document.getElementById('childPanel'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var renderChildTable = function(parentId) { | |
GRAILSUI.childTable.customQueryString = 'id=' + myParentId; | |
var newState = { | |
startIndex: 0, | |
sorting: { // Sort values | |
key: 'id', // or whatever you want the default sort on | |
dir: YAHOO.widget.DataTable.CLASS_ASC | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<gui:menubar> | |
<gui:menuitem url='http://example.com'>Example</gui:menuitem> | |
<gui:submenu label='Foodstuffs'> | |
<gui:menuitem url='http://campbells.com'>Campbell's Soup</gui:menuitem> | |
<gui:menuitem url='http://cheetos.com'>Cheetos</gui:menuitem> | |
<gui:menuitem url='http://guiness.com'>Guiness</gui:menuitem> | |
</gui:submenu> | |
<gui:submenu label='Shoes'> | |
<gui:menuitem url='http://nike.com'>Nike</gui:menuitem> | |
<gui:menuitem url='http://reebok.com'>Reebok</gui:menuitem> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<gui:menu id='myMenu'> | |
<gui:menuitem url='http://example.com'>Example</gui:menuitem> | |
<!-- Grouped and titled --> | |
<gui:menugroup title='Foodstuffs'> | |
<gui:menuitem url='http://campbells.com'>Campbell's Soup</gui:menuitem> | |
<gui:menuitem url='http://cheetos.com'>Cheetos</gui:menuitem> | |
<gui:menuitem url='http://guiness.com'>Guiness</gui:menuitem> | |
</gui:menugroup> | |
<!-- Grouped, no title --> | |
<gui:menugroup> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id='pieChart' style="width:600px; height: 400px"></div> | |
<gui:pieChart | |
renderTo="pieChart" | |
data="[ | |
[ response: 'Summer', count: 564815 ], | |
[ response: 'Fall', count: 664182 ], | |
[ response: 'Spring', count: 248124 ], | |
[ response: 'Winter', count: 271214 ], | |
[ response: 'Undecided', count: 81845 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<gui:dataTable | |
draggableColumns="true" | |
id="dt_3" | |
columnDefs="[ | |
[id:'ID', formatter:'text', sortable:true, resizeable: true], | |
[name:'Name', formatter:'text', | |
editor:[controller:'demo', action:'tableChange', config:[disableBtns:true]], | |
sortable:true, resizeable: true], | |
[birthDate:'Birth Date', formatter:'date', | |
editor:[controller:'demo', action:'tableChange', config:[disableBtns:true]], |