Skip to content

Instantly share code, notes, and snippets.

View gelicia's full-sized avatar
🕴️
Never logging off

Kristina gelicia

🕴️
Never logging off
View GitHub Profile
@gelicia
gelicia / gist:3226507
Created August 1, 2012 12:43
Miso Dataset - Merge Aggregate Datasets
Miso.Dataset.prototype.doesExistGBVal = function(grpByCol, grpByVal) {
var returnVal = false;
this.each(
function(row) {
if (row[grpByCol] == grpByVal) {
returnVal = true;
}
});
return returnVal;
@gelicia
gelicia / gist:3289070
Created August 7, 2012 20:37
Miso Dataset - return an array of split dataviews based on a dataset and a column
//Take in a dataset, split it up by column, return an array of split datasets
Miso.Dataset.prototype.splitDataSets = function(columnName){
var returnArr = []; //Array of split datasets
var valueArr = []; //A list of distinct values from columnName
//Find a distinct list of values
this.each(
function(row) {
if (!valueArr.contains(row[columnName])) {
valueArr.push(row[columnName]);
@gelicia
gelicia / gist:3289089
Created August 7, 2012 20:40
Miso Dataset - return elements of a dataset in a HTML list for viewing
Miso.DataView.prototype.printDVAsList = function() {
var outStr;
if (this.length > 0) {
outStr = "<ul>";
var colNames = this.columnNames();
this.each(
function (row){
outStr = outStr + "<li>";
for (var i = 0; i < colNames.length; i++) {
@gelicia
gelicia / gist:3888251
Created October 14, 2012 10:57
Find original columns for views TSQL SQL Server
WITH view_info (origViewName, viewName, tableName, columnName, viewPath, nestedViewDepth)
AS (
SELECT vCol.view_name, vCol.view_name, vCol.table_name, vCol.column_name,
CAST(vCol.view_name + ',' + vCol.table_name AS VARCHAR(MAX)), 1
FROM INFORMATION_SCHEMA.VIEW_COLUMN_USAGE vCol
UNION ALL
SELECT vi.origViewName, vColChild.view_name, vColChild.table_name, vColChild.column_name,
CAST(vi.viewPath + ',' + vColChild.table_name AS VARCHAR(MAX)),
vi.nestedViewDepth + 1
FROM INFORMATION_SCHEMA.VIEW_COLUMN_USAGE vColChild
@gelicia
gelicia / _.md
Created December 24, 2012 17:13
Practice
@gelicia
gelicia / _.md
Created December 28, 2012 21:22
Show me how to sort!
@gelicia
gelicia / _.md
Created December 29, 2012 02:46
Practice sideways
@gelicia
gelicia / _.md
Created February 11, 2013 19:29
Stealing Enjalot's code from a year ago
@gelicia
gelicia / _.md
Created February 12, 2013 01:13
Stacked - Stealing Enjalot's code from a year ago
@gelicia
gelicia / _.md
Created February 13, 2013 15:42
Simple(?) Stacked Bar Charts