Skip to content

Instantly share code, notes, and snippets.

@hubgit
hubgit / article-meta.txt
Last active May 30, 2018 10:39
HTML meta tags used by journal articles. ISSNs from http://www.crossref.org/titleList/ 5 DOIs of articles published in 2012 from http://search.labs.crossref.org/dois?year=2012&type=Journal+Article&rows=5&q={ISSN} 19,868 ISSNs, 96,751 files. Numbers given are number of ISSNs with that meta[name][content] (i.e. maximum is 19,868). Caveat: some of …
[citation_title] => 10193
[citation_journal_title] => 10171
[citation_volume] => 9878
[citation_pdf_url] => 9671
[citation_issue] => 9560
[citation_issn] => 9483
[citation_firstpage] => 9376
[citation_doi] => 9324
[robots] => 8939
[citation_abstract_html_url] => 8906
@cstephe
cstephe / backspacedirective
Last active March 9, 2021 02:15
Angular directive: prevent backspace from acting like the back button
.directive('backSpaceNotBackButton', [function(){
return {
restrict: 'A',
link: function(scope, element, attrs){
// This will stop backspace from acting like the back button
$(element).keydown(function (e) {
var elid = $(document.activeElement)
.filter(
"input:not([type], [readonly]),"+
"input[type=text]:not([readonly]), " +

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.

@kottenator
kottenator / simple-pagination.js
Created July 13, 2015 20:44
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;