Skip to content

Instantly share code, notes, and snippets.

@brentsimmons
brentsimmons / JavaScript Indent.js
Last active April 13, 2024 11:27
This is a BBEdit text filter for indenting (and beautifying) JavaScript.
#!/usr/local/bin/node
// PBS 12/5/13
// This is a BBEdit text filter for indenting (and beautifying) JavaScript.
// It goes in ~/Library/Application Support/BBEdit/Text Filters/
//
// On my machine I assigned it a keyboard shortcut: cmd-'
//
// It requires the js-beautify Node module: https://github.com/einars/js-beautify
//
@chrislkeller
chrislkeller / import_json_appsscript.js
Last active March 25, 2024 19:45
Adds what amounts to an =ImportJSON() function to a Google spreadsheet... To use go to Tools --> Script Editor and add the script and save.
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
Title: eLife Lens - A novel way of seeing content

Abstract

Introduction

Working with digital documents used to be hard because for the most part, they come in presentation-centric formats, optimized for print and having the same display across multiple devices. Ultimately, the display of these documents had been preserved to ultimately allow the user to print the exact same document across any device. Content today, however, is no longer being printed out readily; instead, it is read on a variety of platforms spanning computers and mobile devices. The limitations presented by different screen sizes, the lack of tactile feedback that comes from flipping between pages and inability to purely focus on the author’s arguments are problems present in all disciplines.

@jprante
jprante / jsonld.sh
Created December 7, 2012 10:03
JSON-LD in Elasticsearch
curl -XDELETE 'localhost:9200/jsonld'
curl -XPOST 'localhost:9200/jsonld'
curl -XPUT 'localhost:9200/jsonld/doc/1' -d '
{
"@context":
{
"dc": "http://purl.org/dc/elements/1.1/",
@mbostock
mbostock / .block
Last active January 10, 2024 01:25
World Tour
license: gpl-3.0
redirect: https://observablehq.com/@mbostock/world-tour
@jbroadway
jbroadway / Slimdown.md
Last active February 5, 2024 10:43
Slimdown - A simple regex-based Markdown parser.
@hubgit
hubgit / mendeley-fetch.php
Created September 22, 2011 10:57
Minimal PHP class for fetching data from the Mendeley API
<?php
// register at http://dev.mendeley.com/applications/
define('MENDELEY_CONSUMER_KEY', ''); // edit this
class Mendeley {
static function fetch($path, $params = array()) {
$default = array('consumer_key' => MENDELEY_CONSUMER_KEY);
$url = 'http://api.mendeley.com/oapi/' . $path . '?' . http_build_query($params + $default);
return json_decode(file_get_contents($url), true);
@lindenb
lindenb / Makefile
Created August 13, 2011 12:15
Fuse-based Filesystem for NCBI taxonomy
FUSEDIR=/home/lindenb/tmp/FUSE
CFLAGS= -D_FILE_OFFSET_BITS=64 -I $(FUSEDIR)/include -Wall
LDFLAGS=-L $(FUSEDIR)/lib
all:test
test:fusetaxonomy nodes.dmp names.dmp
rm -f /tmp/jeter.txt
mkdir -p tmp_fuse
./fusetaxonomy nodes.dmp names.dmp tmp_fuse
-ls tmp_fuse
-ls tmp_fuse/root/
@ryanmcgrath
ryanmcgrath / JapaneseRegex.js
Created May 20, 2011 02:32 — forked from sym3tri/JapaneseRegex.js
Regex to test for presence of Japanese characters
// REFERENCE UNICODE TABLES:
// http://www.rikai.com/library/kanjitables/kanji_codes.unicode.shtml
// http://www.tamasoft.co.jp/en/general-info/unicode.html
//
// TEST EDITOR:
// http://www.gethifi.com/tools/regex
//
// UNICODE RANGE : DESCRIPTION
//
// 3000-303F : punctuation
@philcryer
philcryer / bhldata_box.sh
Created October 13, 2010 20:15
Get latest bhl.zip, rename it with the date, generate an md5 of it, move those files into a Dropbox directory, get the public Dropbox URL for that file, create a HTML file containing a link to that, and put that URL and put that HTML in on a webserver.
#!/bin/bash
DATE=`date +%Y%m%d`
TARGET_PATH=/home/phil/Dropbox/Public
WWW_USER=www-data
WWW_GROUP=www-data
WWW_PATH=/var/www/data
if [ ! -d ${WWW_PATH} ]; then
mkdir -p ${WWW_PATH}
chown -R ${WWW_USER}:${WWW_GROUP} ${WWW_PATH}