Skip to content

Instantly share code, notes, and snippets.

const sections = data.triggerPoints;
const seo = data.seo;
//const activeSection = [];
t = scrollTop+ headerOffset;
if (t < sections[0][1])
return R.find((_seo) => $('body').hasClass(_seo.id), seo);
var hasSEO = (_id) => R.find((_seo) =>_seo.id==_id, seo) != undefined;
var getSEOByPosition = function(scrollTop, headerOffset) {
//--------------------
onsole.log('LENGTH', sections.length);
/* for (var i=0; i<sections.length; i++) {
// if position is above or below nav sections then set the activeSection to null
if (t <= sections[0][1] - headerOffset ) {
for(var j=0; j<seo.length; j++) {
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/ramda/0.21.0/ramda.min.js"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<body class="clinical-trials">
<div class="monotherapy"></div>
</body>
<script>
/*
t can be any of 1 to 5000
@haknick
haknick / gist:11010798
Created April 17, 2014 20:51
Bacon.js Bus
var Bacon = require('baconjs');
var bus = new Bacon.Bus();
bus.onValue(function(){
var a = Bacon.fromArray([1,2,3])
a.onValue(function(val){
console.log(val)
@haknick
haknick / gist:7394776
Created November 10, 2013 06:56
Mac Vagrant Postgresql 9.1 - Provisioning snippet
# On Mavericks (same for 10.6+) the biggest issue is that port 5432 is already taken so
# this: --- config.vm.network "forwarded_port", guest: 5432, host: 5433' ---
# should go on 'Vagrantfile' and then you use port 5433 to connect through pgadmin3
echo >&2 "===CUSTOM-MSG=== Setup THE DATABASE"
# installs postgresql database and creates "vagrant" superuser with password "somepass".
sudo apt-get -y install postgresql postgresql-client libpq-dev
echo >&2 "===CUSTOM-MSG=== Create role and login"