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
css | |
.sliderHolder { | |
display: flex; | |
position: relative; | |
overflow-x: hidden; | |
&:hover { | |
.sliderArticle { | |
transition: all ease 5s; | |
transform: translateX(-50px); |
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 AjaxForm = function(formId) { | |
var form = document.getElementById(formId), | |
postLoc = Drupal.absoluteUrl(jQuery(form).attr('action')), | |
submit = jQuery(form).find('[type="submit"]'); | |
submit.click(function(e) { | |
e.preventDefault(); | |
if(form.validator) { | |
if(form.validate()) { | |
jQuery.post(postLoc, jQuery(form).serialize()); | |
} |
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 k = $('select'), p =[]; | |
for(i =0;i <k.length; i++) {p.push("#" + k[i].id)}; | |
console.log(p); |
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
<link href='https://fonts.googleapis.com/css?family=Tinos:400,700|Playfair+Display:400,700' rel='stylesheet' type='text/css'> | |
font-family: 'Tinos', serif; | |
font-family: 'Playfair Display', serif; | |
@keyframes zoom { | |
0% { | |
transform: scale(1); | |
} |
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
function csvJSON(csv){ | |
var lines=csv.split("\n"); | |
var result = []; | |
var headers=lines[0].split("\t"); | |
for(var i=1;i<lines.length;i++){ | |
var obj = {}; |
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
//Converts TSV string into Multi Diamensional Array | |
//Example: tsvToMultiDiaArray("h1\th2\th3\n1\t2\t3\n44\t22\t66") | |
function tsvToMultiDiaArray(tsv) { | |
var results = []; | |
var lines = tsv.split('\n'); | |
var headers = lines[0].split('\t'); | |
var row; | |
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
data = [['a', 'b', 20], ['a', 'b', 20], ['a', 'b', 20]]; | |
graph = {"nodes" : [], "links" : []}; | |
data.forEach(function (d) { | |
graph.nodes.push({ "name": d[getInputProperty('source')] }); | |
graph.nodes.push({ "name": d[getInputProperty('target')] }); | |
graph.links.push({ "source": d[getInputProperty('name')], | |
"target": d[getInputProperty('target')], | |
"value": +d[getInputProperty('value')] }); |
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
onRemove: function(e) { | |
if (e.target.group.pull === 'clone') { | |
return; | |
} | |
if (template) { | |
template.splice("items", e.oldIndex, 1)[0]; | |
} | |
_this.fire("remove", e); | |
} |
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
http://thenewcode.com/744/Make-SVG-Responsive | |
http://eyeseast.github.io/visible-data/2013/08/28/responsive-charts-with-d3/ | |
http://stackoverflow.com/questions/16265123/resize-svg-when-window-is-resized-in-d3-js |
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
// Flattens an array | |
function flatten(array) { | |
var tmp = []; | |
array.forEach(function (item) { | |
// To store the flattened result if val is an Array | |
var localFlattened; | |
if (item.length) { // if item is an Array | |
localFlattened = flatten(item); // flatten item | |
tmp = merge(tmp, localFlattened); // merge flattened item to parent | |
} else { |
OlderNewer