Skip to content

Instantly share code, notes, and snippets.

<init-param>
<param-name>development</param-name>
<param-value>true</param-value>
</init-param>
can I do this in my code?
if(getServletConfig().getInitParameter("development")) { ...
{
"Name of submitting scientist": "Hesham Agrama, soybean Breeder",
"Institution": "IITA",
"Date of submission": "",
"Crop": "Soybean",
"Name of Trait": "Days To Flowering",
"Trait ID for modification, Blank for New": "",
"Abbreviated name": "DAYFL",
"Synonyms (separate by commas)": "Open flower",
"Description of Trait": "Days after sowning until 50% of the plants have one or more flowers",
<!DOCTYPE HTML>
<link rel="stylesheet" href="http://lmatteis.github.io/bitcoin-notify/theme/default/style.css" type="text/css">
<script src="http://lmatteis.github.io/bitcoin-notify/OpenLayers.js"></script>
<script src="http://lmatteis.github.io/bitcoin-notify/jquery.min.js"></script>
<script>
$(function() {
map = new OpenLayers.Map("demoMap");
map.addLayer(new OpenLayers.Layer.OSM());
var lonlat = new OpenLayers.LonLat(12.482520,41.892916).transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"));
<link rel="stylesheet" href="http://lmatteis.github.io/bitcoin-notify/theme/default/style.css" type="text/css">
<script src="http://lmatteis.github.io/bitcoin-notify/OpenLayers.js"></script>
<script src="http://lmatteis.github.io/bitcoin-notify/jquery.min.js"></script>
<script src="http://lmatteis.github.io/bitcoin-notify/bam.js"></script>
<form method="get" id="submit_bitcoin">
<input type="hidden" placeholder="lat" value="41.892916" id="lat_bitcoin"/>
<input type="hidden" placeholder="lon" value="12.482520" id="lon_bitcoin"/>
<input type="email" placeholder="email" value="" id="email_bitcoin"/>
<br>
@lmatteis
lmatteis / gist:9736733
Created March 24, 2014 09:02
Plain lucaa.org
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1,user-scalable=no">
<title>{block:SearchPage}{lang:Search results for SearchQuery} - {/block:SearchPage}{block:PostSummary}{PostSummary} - {/block:PostSummary}{Title}</title>
<link rel="alternate" type="application/rss+xml" href="{RSS}">
<link rel="shortcut icon" href="{Favicon}" />
{block:Description}<meta name="description" content="{MetaDescription}" />{/block:Description}
@lmatteis
lmatteis / gist:10385294
Last active August 29, 2015 13:58
Genesys scraper in Node.js
var cheerio = require('cheerio')
var request = require('request')
var fs = require('fs')
var N3 = require('n3');
var nurl = require('url');
var genesysPrefix = 'http://www.genesys-pgr.org/acn/id/'
var domain = 'https://www.genesys-pgr.org/acn/'
//loadUrl(domain);
$('th').each(function() {
var str = 'map:' +$(this).text() + ' a d2rq:PropertyBridge;\n';
str += ' d2rq:belongsToClassMap map:LandscapePhotograph;\n\
d2rq:property map:' +$(this).text() + ';\n\
d2rq:propertyDefinitionLabel "' +$(this).text() + '";\n\
d2rq:column "cncp_b.foto_stu2.' +$(this).text() + '";\n\
.\n\n'
$('textarea').val($('textarea').val() + str)
})
@lmatteis
lmatteis / gist:10637679
Created April 14, 2014 10:57
How to run for loop
# runs 100 pages starting at start
start=6310
chunk=10
for ((i=0; i<$chunk; ++i )) ;
do
#node scrape.js 6300 6310 &
startPage="$(( $start + ($i * $chunk) ))"
endPage="$(( $startPage + ($chunk - 1) ))"
node scrape.js $startPage $endPage &
done
start=7600
chunk=1
for ((i=0; i<20; ++i )) ;
do
#node scrape.js 6300 6310 &
startPage="$(( $start + ($i * $chunk) ))"
endPage="$(( $startPage + ($chunk - 1) ))"
#node scrape.js $startPage $endPage &
node scrape2.js $startPage &
done
@lmatteis
lmatteis / gist:11255361
Created April 24, 2014 13:51
Tumblr theme
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1,user-scalable=no">
<title>{block:SearchPage}{lang:Search results for SearchQuery} - {/block:SearchPage}{block:PostSummary}{PostSummary} - {/block:PostSummary}{Title}</title>
<link rel="alternate" type="application/rss+xml" href="{RSS}">
<link rel="shortcut icon" href="{Favicon}" />
{block:Description}<meta name="description" content="{MetaDescription}" />{/block:Description}